I am trying to change the /var/www/html default directory to /var/www/domain.com I have changed this in the httpd config file but it doesn't seem to work. I am running Centos 7 and Apache2
1 Answer
As UlrichSchwartz commented, Debian/Ubuntu/etc uses package name apache2 with configuration in directory /etc/apache2
while RedHat/CentOS/etc uses package name httpd and config directory /etc/httpd
, and does not provide the sites-enabled + a2ensite
scheme by default, although you can construct it if you want.
If you want to change the (by default only one) doc root, just edit /etc/httpd/conf/httpd.conf
. If you want to set up virtual hosts, so that for example http://example.com/
goes a different place (or places) than http://localhost/
, then you get to decide whether you want to put them in the one config file, or split them out into several files in /etc/httpd/conf.d/
(note the dot dee). Often having each vhost in its own file is convenient, but this is by no means required.
PS: there is no Apache 1. /usr/sbin/apachectl
is ctl as in charlie thomas lunatic, not one.
-
Thank you for this information. I will make the appropriate changes.TwitchedOut– TwitchedOut2016-06-14 04:04:17 +00:00Commented Jun 14, 2016 at 4:04
/etc/httpd
, not/etc/apache2
. (And they may or may not provide thesites-available
scheme.)