Telepítés
apt-get install apache2
Indítás/Leállítás és újraindítás
service
service apache2 start
service apache2 stop
service apache2 restart
/etc/init.d/
/etc/init.d/apache2 start
/etc/init.d/apache2 stop
/etc/init.d/apache2 restart
systemctl
systemctl start apache2.service
systemctl stop apache2.service
systemctl restart apache2.service
Elérési útvonalak
/
|
- /etc
| |
| - /apache2
| |
| - /sites-available
| | |
| | - 000-default.conf
| |
| - apache2.conf
|
- /var
|
- /www
|
- /html
| |
| - /blog
| | |
| | - /web
| |
| - /forum
| | |
| | - /web
| |
| - /webshop
| |
| - /web
|
- index.html
Virtuális állomások
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
</VirtualHost>
<VirtualHost *:80>
ServerName blog.localhost
DocumentRoot /var/www/html/blog/web
</VirtualHost>
<VirtualHost *:80>
ServerName forum.localhost
DocumentRoot /var/www/html/forum/web
</VirtualHost>
<VirtualHost *:80>
ServerName webshop.localhost
DocumentRoot /var/www/html/webshop/web
</VirtualHost>
Az Apache dokumentum gyökérmappájának a módosítása másodlagos merevlemezre
sudo usermod -aG www-data username
sudo chown -R www-data:www-data /path/to/my/project
nano /etc/apache2/sites-available/000-default.conf
DocumentRoot /path/to/my/project
sudo service apache2 restart
Ha azt a tiltott üzenetet kapjuk, hogy nincs engedélyünk a / elérésére ezen a szerveren az apache gyökércseréje után, akkor kövessük az alábbi lépéseket
nano /etc/apache2/apache2.conf
<Directory />
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
a2enmod, a2dismod