Ubuntu server 12.04/apache2
From Attie's Wiki
(Difference between revisions)
m |
m |
||
Line 11: | Line 11: | ||
chown www-data:www-data /home/www | chown www-data:www-data /home/www | ||
</source> | </source> | ||
+ | |||
+ | Path goes with TLD first, and a few other rules. E.g: | ||
+ | {| | ||
+ | |align="right"| <code>www.attie.co.uk</code> || → || <code>/home/www/attie.co.uk/htdocs</code> (www and TLD route to 'htdocs') | ||
+ | |- | ||
+ | |align="right"| <code>wiki.attie.co.uk</code> || → || <code>/home/www/attie.co.uk/wiki</code> | ||
+ | |- | ||
+ | |align="right"| <code>joke.test.attie.co.uk</code> || → || <code>/home/www/attie.co.uk/test/joke</code> | ||
+ | |} | ||
===Setup sites=== | ===Setup sites=== | ||
Add a site file in <code>/etc/apache2/sites-available</code>. | Add a site file in <code>/etc/apache2/sites-available</code>. | ||
Enable the site by symlinking it into <code>/etc/apache2/sites-enabled</code>. | Enable the site by symlinking it into <code>/etc/apache2/sites-enabled</code>. |
Revision as of 20:23, 2 May 2012
Configuring an Apache server
apt-get install apache2 libapache2-mod-php5
Configuration is in /etc/apache2
Store site content in /home/www
mkdir /home/www chown www-data:www-data /home/www
Path goes with TLD first, and a few other rules. E.g:
www.attie.co.uk |
→ | /home/www/attie.co.uk/htdocs (www and TLD route to 'htdocs')
|
wiki.attie.co.uk |
→ | /home/www/attie.co.uk/wiki
|
joke.test.attie.co.uk |
→ | /home/www/attie.co.uk/test/joke
|
Setup sites
Add a site file in /etc/apache2/sites-available
.
Enable the site by symlinking it into /etc/apache2/sites-enabled
.