Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual Hosts

Status
Not open for further replies.

HungrySnail

Technical User
Jan 26, 2007
3
GB
Hi Guys,

Have a question for you (bit of an apache beginner) :)

I have a server that doesnt have a domain name and never will have one and so it is only viewable by its IP.

How would I make address/~test/ point to /home/test/www


Thanks in advance for any help you can provide.
 
If this machine is only going to have 1 "host", you don't even need VirtualHosts, the one default will be fine. You should be able to run with very few changes to the default httpd.conf that was created during installation. Look for these directives. The only one that will really need to be changed is the DocumentRoot, but the others will be for good measure.

Servername *:80
DocumentRoot /home/test/www
ServerAdmin your_email_address@xxxxxx

Be sure that the apache user (probably apache or nobody) is allowed read permisssion by the filesystem for that document root. Restart apache after making the changes.
 
thanks for the reply guys.

Im not sure if the server will only have one host at this time.

There will be a few of us using the server and if im put in a situation where someone else wants a seperate section how would I go about it?.

Example...

point to /home/space1/www
point to /home/space2/www
 
You can use UserDir directive. This will create a public_html sub-directory in the users /home. You would only crreate this container once. When a new user is added. A webspace will be created automatically. There should be a sample container already setup in httpd.conf but you will need to delete most of the stuff in there because it is pretty much useless the way it is. Use the default DocumentRoot in the main section as an example of the directives that should go in there. Your network can access the server by it hostname. Let's say the hostname is Server1. Then users on the network can access they webspace by going to From outside your network, they will access it with you public ip followed by /~username.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top