Good morning all. I have set up many servers running virtual web hosts. I use Debian as my preferred distro which is the base build of Ubuntu.
Here is a link that got me through a lot of configs when I started setting up web servers initially. http://www.howtoforge.com/perfect_setup_ubuntu_6.06 this will guide you through many steps to getting your server up and running. If you are only seeking apache then you would be able to skip most of the pages, just stick to apache and mysql if you wish to have your websites integrated into a database. One change I make when it comes to setting up multiple web sites is to create different user accounts to host each site. This is very handy when it comes to administration of the site itself. I used to work for an ISP who managed mail and websites and by using different user accounts, it allows the owner of the site to log in via ftp and go straight to their home drive and modify their site themselves, this was a great benefit as it puts less work onto the administrator of the server. Below is a sample of my /etc/apache2/sites-enabled/000-default file, Debian and I think Ubuntu uses different files to manage apache that some other distros who use one standard apache.conf or http.conf files. This is the standard web site which resides in /var/www, you would be directed to this directory if you type in the hostname of the server or IP address NameVirtualHost * <VirtualHost *> ServerAdmin [EMAIL PROTECTED] DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all # This directive allows us to have apache2's default start page # in /apache2-default/, but still have / go to the right place #RedirectMatch ^/$ /apache2-default/ </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost> Below is what a basic virtual host site config looks like. It resides in the /home/hosting parent directory. In this example the person managing the site would log into the server via ftp with the username "hosting" <VirtualHost *> #Basic setup ServerAdmin [EMAIL PROTECTED] ServerName my.virtualsite.com DocumentRoot /home/hosting/my.virtualsite.com/htdocs/ Alias /sysinfo /var/www/phpsysinfo # HTML documents, with indexing. <Directory /> Options +Includes </Directory> # CGI Handling ScriptAlias /cgi-bin/ /home/hosting/ my.virtualsite.com /cgi-bin/ <Location /cgi-bin> Options +ExecCGI </Location> # Logfiles ErrorLog /home/hosting/ my.virtualsite.com /logs/error.log CustomLog /home/hosting/ my.virtualsite.com /logs/access.log combined </VirtualHost> In the folder /home/hosting/my.virtualsite.com/ there are 3 directories which I created manually, htdocs (this is used for the content of the site), logs, (logs access and errors that the site gives) and cgi-bin (this is a private location for any cgi scripts you may wish to integrate into your website. Once this is done your apache config is done. To make the site work effectively now, all that needs to be done is create a site and also point your dns server which hosts the domain virtualsite.com to this server's IP address. By adding a CNAME that points to an already configured A record will do the trick. If your DNS server is hosted outside your network, e.g. your domain registrar then your IP here would be your external IP address. If you wish the site to work internally also you would also need to configure your internal DNS with your internal IP address. This is all that is required to set up virtual websites in apache. If you haven't restarted apache already run /etc/init.d/apache2 restart as root. I generally create a basic index.html file in the htdocs of your website just to test if the site is working. <html> <body>Test page for my.virtualsite.com </body> </html> I hope this helps with what you are trying to achieve. Dale ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of brucetcampbell Sent: Friday, 15 December 2006 3:23 AM To: [email protected] Subject: [LINUX_Newbies] Newby server questions Greetings Everybody, I am a newby to Linux and I hope someone can help or steer me in the right direction. I would like to setup a web server. I have Ubuntu installed on a spare computer and apache is installed. ( I can switch to a different distro if it is preferable) How do I setup webpages? I believe the instructions said to setup my webpages under \www. I have reviewed that directory and I see the current index.html. However I can not access it. It opens when I go to localhost. I thought I could simply create a new index and copy and paste. No luck. How do I access and modify the directory? How do I add a new webpage or site. I am not trying to establish a fully fledged server that will host multiple domains. I would like to setup a simple webserver/fileserver that I can access for my own purposes. I intended to open a port on my router and direct it to the Linux webserver. essentially creating a new index.html page and that page would serve as my directory to other pages or files. Any suggestions/advice would be greatly appreciated Bruce PRIVACY & CONFIDENTIALITY NOTICE: The information contained in this e-mail is intended for the named recipient(s) only and may contain information of a private and confidential nature. If you are not the named recipient you are not permitted to copy, discuss, distribute, or take any action in relation to this message. The opinions, conclusions and other information contained in the message are those of the sender and not necessarily those of Green Point Christian College Limited. If you have received this message in error, or if transmission is incomplete, please contact the sender immediately. This e-mail message has been scanned for Viruses and Content and cleared by NetIQ MailMarshal. However, Green Point Christian College does not represent or warrant that attached files are free from computer viruses or other defects. ************************************************************************ [Non-text portions of this message have been removed] To unsubscribe from this list, please email [EMAIL PROTECTED] & you will be removed. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/LINUX_Newbies/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/LINUX_Newbies/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
