Apache is a cross-platform software that supports Linux, BSD, Mac OS, Microsoft Windows, Novell NetWare, and BeOS operating systems.
Installation Apache2:
To install Apache2 on VDS, you must register:
apt-get install apache2Customization Apache2:
To configure Apache2, go to /etc/apache2/sites-available and create a file modeled on site.conf:
<VirtualHost *:80>
ServerName spacecore.pro # Specify the site domain
ServerAdmin admin@spacecore.pro # Your email address
DocumentRoot /var/www/html # The path to the site folder
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>Turning on the site, the site.conf location should be the name of the config that you created:
a2ensite site.confIf you need to disable the site, the name of the config should be instead of site.conf:
Rebooting apache2:
Connecting PHP to Apache2:
In order for Apache to display php files correctly, you need to install the package:
Rebooting apache2:
Enabling rewrite:
Without this option, 70% of CMS for websites will not work.
Most sites contain a file.htaccess must be registered for its operation:
Rebooting apache2:
Enabling SSL:
You need to enable the module that is responsible for SSL:
Creating another config in /etc/apache2/sites-available, it will be responsible for SSL, for example site-ssl.conf:
Rebooting apache2:
Check на nginx:
If apache2 is installed with nginx, then they will conflict due to port - 80. So you need to delete one of the web servers. Check if nginx is installed:
If nginx is installed, you need to delete it:
Removal Apache2
To remove Apache2, use:
Last updated