There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Linux and Unix
Tag Cloud
access acer asus batch bios bsod computer crash driver drivers error ethernet excel freeze gaming google gpu hard drive hardware hdmi internet java laptop malware memory missing monitor motherboard mouse network printer problem ram registry router slow software sound trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Apache2 Web Server

Reply  
Thread Tools
AKA Arizona's Avatar
Computer Specs
Senior Member with 2,914 posts.
 
Join Date: Jul 2003
Location: Mississippi South of Mason Dix
Experience: Computer & Web Design
09-Dec-2005, 01:38 PM #1
Apache2 Web Server
I did a search and did not find exactly what I was looking for:

I have Kwrite open looking at my http.conf file

# This is here for backwards compatability reasons and to support
# installing 3rd party modules directly via apxs2, rather than
# through the /etc/apache2/mods-{available,enabled} mechanism.
#
#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so

and my ports.conf has

Listen 80

my question is how and where do I put my information to allow my port 80 redirect my router redirects to 192.168.1.87 and my eth0 is set the same, to open my web sites www.akaarizona.com www.gadgetinc-ms.com www.ihim.us www.castawaypools.com www.ecocleancarpets.com and several others they are on a second hdd /mnt/hdc1

And I need an ftp service

Last edited by AKA Arizona; 09-Dec-2005 at 01:52 PM..
linuxphile's Avatar
Administrator with 429 posts.
 
Join Date: Mar 2003
Location: MD
Experience: Intermediate
09-Dec-2005, 02:07 PM #2
If I understand correctly, you have added the port 80 redirection to your router so that port 80 requests are going to the Mepis machine. And what you are asking for now is how to get apache to serve up those domains, which are stored on a separate hard drive?

You will probably use VirtualHost declarations in your httpd.conf file. VirtualHosts allow you to configure apache to serve up different domains from different directories.

Here is an excerpt from my httpd.conf with the relavent VirtualHost declarations:

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /var/www/html/
Servername www.linuxphile.org
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /var/www/html/fairytale
Servername subdomain.linuxphile.org
</VirtualHost>


I recommend reading up on this at http://httpd.apache.org/docs/2.0/vhosts/examples.html
__________________
http://about.me/dmccarthy
AKA Arizona's Avatar
Computer Specs
Senior Member with 2,914 posts.
 
Join Date: Jul 2003
Location: Mississippi South of Mason Dix
Experience: Computer & Web Design
09-Dec-2005, 02:17 PM #3
OK so after the

# This is here for backwards compatability reasons and to support
# installing 3rd party modules directly via apxs2, rather than
# through the /etc/apache2/mods-{available,enabled} mechanism.
#
#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /mnt/hdc1/websites/akaaz/
Servername www.akaarizona.com
</VirtualHost>

and so on until I have all website listed
linuxphile's Avatar
Administrator with 429 posts.
 
Join Date: Mar 2003
Location: MD
Experience: Intermediate
09-Dec-2005, 03:09 PM #4
Correct, and after all the edits you'll need to restart Apache. You should of course make a backup copy of your httpd.conf prior to making any edits.
AKA Arizona's Avatar
Computer Specs
Senior Member with 2,914 posts.
 
Join Date: Jul 2003
Location: Mississippi South of Mason Dix
Experience: Computer & Web Design
09-Dec-2005, 03:23 PM #5
ok now you raised a new question how do I stop then restart apache?
linuxphile's Avatar
Administrator with 429 posts.
 
Join Date: Mar 2003
Location: MD
Experience: Intermediate
09-Dec-2005, 03:27 PM #6
I believe these will work for you:

/etc/init.d/apache restart
/etc/init.d/apache stop
/etc/init.d/apache start
Squashman's Avatar
Trusted Advisor with 18,705 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
09-Dec-2005, 03:35 PM #7
Since you are running Linux, I would suggest you run OpenSSH server. People can do secure connection to your server then to transfer files. Otherwise I suggest you use VSFTPD if you don't want to go the Secure Shell Server route.
AKA Arizona's Avatar
Computer Specs
Senior Member with 2,914 posts.
 
Join Date: Jul 2003
Location: Mississippi South of Mason Dix
Experience: Computer & Web Design
09-Dec-2005, 03:37 PM #8
OK I thought of one more, not all of my home pages are called index.htm or .html would I have to be specific on this line: DocumentRoot /mnt/hdc1/websites/akaaz/akaaz.html or is there something different I need to do?
linuxphile's Avatar
Administrator with 429 posts.
 
Join Date: Mar 2003
Location: MD
Experience: Intermediate
09-Dec-2005, 03:40 PM #9
You'll need a global directive:
DirectoryIndex index.html index.htm index.html.var index.cgi index.php

Put them in the order of precedence. http://httpd.apache.org/docs/2.0/mod...directoryindex has more info on this.
Squashman's Avatar
Trusted Advisor with 18,705 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
09-Dec-2005, 03:43 PM #10
There is a line in your httpd.conf file that says directory index. On this line you put what files you want. I usually change mine to default.html instead of index.html just because I like to be different.

DirectoryIndex default.html default.htm default.shtml default.php default.php4 default.php3 default.phtml default.cgi
AKA Arizona's Avatar
Computer Specs
Senior Member with 2,914 posts.
 
Join Date: Jul 2003
Location: Mississippi South of Mason Dix
Experience: Computer & Web Design
09-Dec-2005, 03:47 PM #11
so my httpd.conf would look like this:

# This is here for backwards compatability reasons and to support
# installing 3rd party modules directly via apxs2, rather than
# through the /etc/apache2/mods-{available,enabled} mechanism.
#
#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /mnt/hdc1/websites/akaaz/
DirectoryIndex akaarizona.html
Servername www.akaarizona.com
</VirtualHost>
linuxphile's Avatar
Administrator with 429 posts.
 
Join Date: Mar 2003
Location: MD
Experience: Intermediate
09-Dec-2005, 03:48 PM #12
You can put it inside the VirtualHost directives, but you could also make it global by placing it above the NameVirtualHost *:80 directive.
AKA Arizona's Avatar
Computer Specs
Senior Member with 2,914 posts.
 
Join Date: Jul 2003
Location: Mississippi South of Mason Dix
Experience: Computer & Web Design
09-Dec-2005, 04:07 PM #13
I stopped and started Apache2 and got this error for every website

[Fri Dec 09 14:02:52 2005] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Fri Dec 09 14:02:52 2005] [warn] NameVirtualHost *:80 has no VirtualHosts

This is my httpd.conf file:

# This is here for backwards compatability reasons and to support
# installing 3rd party modules directly via apxs2, rather than
# through the /etc/apache2/mods-{available,enabled} mechanism.
#
#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so
#
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /mnt/hdc1/websites/AKAAZ/
DirectoryIndex akaarizona.html
Servername www.akaarizona.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /mnt/hdc1/websites/GADGET/gflash/
DirectoryIndex gflash.htm
Servername www.gadgetinc-ms.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /mnt/hdc1/websites/IHIM/
DirectoryIndex ihim.htm
Servername www.ihim.us
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /mnt/hdc1/websites/castaway/
DirectoryIndex castaway.htm
Servername www.castawaypools.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /mnt/hdc1/websites/ccleaner/
DirectoryIndex index.htm
Servername www.ecocleancarpets.net
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /mnt/hdc1/websites/PCSO/
DirectoryIndex index.html
Servername www.prentisscountysheriff.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /mnt/hdc1/websites/downinmexico/
DirectoryIndex downinmexico.html
Servername www.downinmexico.net
</VirtualHost>
linuxphile's Avatar
Administrator with 429 posts.
 
Join Date: Mar 2003
Location: MD
Experience: Intermediate
09-Dec-2005, 04:13 PM #14
Hrm. That's worked for me but I've also got my Listen 80 directive in my httpd.conf file, not a separate file. You can try changing the NameVirtualHost directive to:
#Replace 192168.X.X with the IP of your server.
NameVirtualHost 192.168.X.X

#Then Replace the <VirtualHost *:80> with (again replace 192.168.X.X with your server's IP)
<VirtualHost 192.168.X.X>
__________________
http://about.me/dmccarthy
AKA Arizona's Avatar
Computer Specs
Senior Member with 2,914 posts.
 
Join Date: Jul 2003
Location: Mississippi South of Mason Dix
Experience: Computer & Web Design
09-Dec-2005, 04:22 PM #15
before I run with this further, my server is not connected to the location it will run from. I am at work the server will be at home, does that make a difference?
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 04:05 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.