httpd (apache)
Important
|
Solus is not a server operating system. Usage of server packages outside local testing is not recommended. |
httpd (Apache) is installed with a default configuration that you can customize as needed.
Installation
To install httpd
, use the Software Center or execute the following command:
sudo eopkg install httpd
Usage
Configuration and DocumentRoot
The default configuration files for Apache are located in the /usr/share/defaults/httpd/
directory. To override the default configuration, create a new file with the .conf
extension in the /etc/httpd/conf.d
directory.
Important
|
If you modify the configuration files located in the |
The document root is the directory where Apache serves files from. By default, the document root is /var/www/
.
Enabling PHP Support
-
Install
php
from the Software Center or execute the following command:sudo eopkg install php
. -
Create a new
/etc/httpd/conf.d/php.conf
file with the following contents:LoadModule proxy_module lib64/httpd/mod_proxy.so LoadModule proxy_fcgi_module lib64/httpd/mod_proxy_fcgi.so <FilesMatch \.php$> SetHandler "proxy:fcgi://127.0.0.1:9000" </FilesMatch> <IfModule dir_module> DirectoryIndex index.php index.html </IfModule>
-
Execute the following command:
sudo systemctl restart httpd && sudo systemctl restart php-fpm
Management
You can use the following commands to manage httpd:
-
Enable httpd on startup:
sudo systemctl enable httpd
. -
Start the web server:
sudo systemctl start httpd
-
Stop the web server:
sudo systemctl stop httpd
== httpd (Apache)