Setting up a web server

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Setting up a web server

Postby mikejd » Fri Apr 22, 2005 8:49 am

I am setting up an old machine to use as a web server internally on my office network. This is for design purposes before uploading sites to a webhost. I am using MDK9.0 and Apache/php and have it running OK.

I can open the web server using 192.168.0.3:80 which opens the file at /var/www/html/index.shtml. I have replaced this file with my own index.html which is fine.

Question : I would like to keep the files for the web sites on /home and would like to know how to reference them. I have tried, temporarily, accessing a content management system at /home/mike/tmp/cinj152/index.php as a link but get a 404 error. What am I doing wrong?

Any advice welcome. TIA

Mike Davies
mikejd
LXF regular
 
Posts: 132
Joined: Fri Apr 08, 2005 4:46 pm
Location: Huntly, Aberdeenshire

RE: Setting up a web server

Postby nelz » Fri Apr 22, 2005 9:26 am

Change the DocumentRoot setting in Apache's config file - usually /etc/apache2/httpd.conf.

You will also need to change the <Directory> settings to suit. The file is well commented.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8552
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

RE: Setting up a web server

Postby Guest » Tue Apr 26, 2005 10:24 am

Thanks nelz.
I couldn't find the config file where you said but I think I found it at /etc/httpd/conf/httpd2.conf. There is a setting for DocumentRoot which I can change.
However, I couldn't find any reference in the file to <Directory>. Is this perhaps in a different file?
Guest
 

RE: Setting up a web server

Postby nelz » Tue Apr 26, 2005 11:05 am

Possibly. the location and number of Apache config files is a moveable feast, based on distro, Apache version, prevailing wind and other factors. The good news is that wherever they are, they are always kept together in one directory, so it will be in one of the files in /etc/httpd/conf/.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8552
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Re: RE: Setting up a web server

Postby nbnbn » Sun May 15, 2005 5:05 pm

nbnbn
 

RE: Re: RE: Setting up a web server

Postby skecs » Mon May 16, 2005 8:17 am

Just a quick one - Apache files have moved to /etc/apache2 and the conf files have been restructured slightly. The setting you are looking for looks like this (in default-server.conf):

# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# To disable it, simply remove userdir from the list of modules in APACHE_MODULES
# in /etc/sysconfig/apache2.
....... some junk in here ........
UserDir public_html
Regards from
Downunder!
.... _
... (0)>
... / /\
.. / / .)
.. V_/_
Linux Powered!
User avatar
skecs
 
Posts: 76
Joined: Fri Apr 22, 2005 9:22 am
Location: Bathurst, NSW Australia


Return to Help!

Who is online

Users browsing this forum: No registered users and 4 guests

cron