Home > Debian Linux > Apache

Install
aptitude install apache2
(home folder: /var/www/apache2-default/)

Edit port
vim /etc/apache2/ports.conf
/etc/init.d/apache2 reload

Change home directory
vim /etc/apache2/sites-enabled/000-default
# RedirectMatch ^/$ /apache2-default/
(redirect = edit the url)
/etc/init.d/apache2 reload

Add virtual directory
vim /etc/apache2/sites-enabled/000-default
Alias /virtual/ /var/www/real
<Directory "/var/www/real">
</Directory>
/etc/init.d/apache2 reload

Add virtual host
vim /etc/apache2/sites-available/cse
NameVirtualHost *
<VirtualHost *>
ServerName cse.ust.com
DocumentRoot /cse/
</VirutalHost>
vim /etc/apache2/sites-available/cpeg
<VirtualHost *>
ServerName cpeg.ust.com
DocumentRoot /cpeg/
</VirutalHost>
a2ensite cse
a2ensite cpeg
/etc/init.d/apache2 reload

Enable userdir
a2enmod userdir
mkdir /home/alan/public_html
chmod 755 /home/alan/public_html
http://127.0.0.1/~alan

. Install
- aptitude install apache2
- (home folder: /var/www/apache2-default/)
. Edit port
- edit /etc/apache2/ports.conf
- /etc/init.d/apache2 reload
. Change home directory
- edit /etc/apache2/sites-enabled/000-default
# RedirectMatch ^/$ /apache2-default/
(redirect = edit the url)
- /etc/init.d/apache2 reload
. Add virtual directory
- edit /etc/apache2/sites-enabled/000-default
Alias /virtual/ /var/www/real
<Directory "/var/www/real">
</Directory>
- /etc/init.d/apache2 reload
. Add virtual host
- vim /etc/apache2/sites-available/cse
NameVirtualHost *
<VirtualHost *>
ServerName cse.ust.com
DocumentRoot /cse/
</VirutalHost>
- vim /etc/apache2/sites-available/cpeg
<VirtualHost *>
ServerName cpeg.ust.com
DocumentRoot /cpeg/
</VirutalHost>
- a2ensite cse
- a2ensite cpeg
- /etc/init.d/apache2 reload
. Enable userdir
- a2enmod userdir
- mkdir /home/alan/public_html
- chmod 755 /home/alan/public_html
- http://127.0.0.1/~alan



« « Compression sudo » »
Flag Counter