

See #Managing many virtual hosts for an example file. Note: You will need to add a separate section for virtual host SSL support. For more info refer to the Apache documentation. htaccess files, you can allow which directives declared in that file can override server configuration. If you intend to use mod_rewrite or other settings in. Note that this is now the default for Apache 2.4, so you need to explicitly allow overrides if you plan to use. This directive in sections causes Apache to completely ignore. Remember that the DocumentRoot directory and its parent folders must allow execution permission to others (can be set with chmod o+x /path/to/DocumentRoot), otherwise you will get a 403 Error. Do not forget to change the Require all denied line to Require all granted, otherwise you will get a 403 Error. Change it, if you want to, but do not forget to also change to whatever you changed your DocumentRoot to, or you will likely get a 403 Error (lack of privileges) when you try to access the new document root.

This is the directory where you should put your web pages. ServerAdmin is the admin's email address which can be found on e.g. Then change this line to Listen 127.0.0.1:80. If you want to setup Apache for local development you may want it to be only accessible from your computer. For Internet-access with router, you have to forward the port. The default user is http, which is created automatically during installation. These options in /etc/httpd/conf/nf might be interesting for you:įor security reasons, as soon as Apache is started by the root user (directly or via startup scripts) it switches to this UID. See the full list of Apache configuration directives and the directive quick reference. It should display a simple index page.įor optional further configuration, see the following sections. To start Apache, start rvice using systemd.Īpache should now be running. By default, it will serve the directory /srv/http to anyone who visits your website. The default configuration file should be fine for a simple setup. The main configuration file is /etc/httpd/conf/nf, which includes various other configuration files.

