Eu instalei o apache2, mysql, php e phpmyadmin. O local da raiz está em /var/www
agora, mas eu queria alterá-lo para algo como /home/user/sites
ou algo assim. Nos outros segmentos, a solução foi adicionar algum código no arquivo 000-default.conf
na pasta sites-enabled
, mas não existe esse arquivo na minha pasta, na verdade não há arquivo na pasta /etc/apache2/sites-enabled
. Então, como eu mudo a localização agora?
$ ls -l /etc/apache2/sites-enabled
total 0
$ ls -l /etc/apache2/sites-available
total 16
-rw-r--r-- 1 root root 1582 अक्टूबर 17 07:26 000-default.conf
-rw-r--r-- 1 root root 1338 अक्टूबर 13 22:51 000-default.conf~
-rw-r--r-- 1 root root 6432 जुलाई 21 2013 default-ssl.conf
$ apt-cache policy apache2
Installed: 2.4.6-2ubuntu2.2
Candidate: 2.4.6-2ubuntu2.2
Version table:
*** 2.4.6-2ubuntu2.2 0
500 http://np.archive.ubuntu.com/ubuntu/ saucy-updates/main i386 Packages
500 http://security.ubuntu.com/ubuntu/ saucy-security/main i386 Packages
100 /var/lib/dpkg/status
2.4.6-2ubuntu2 0
500 http://np.archive.ubuntu.com/ubuntu/ saucy/main i386 Packages
O conteúdo de 000-default.conf
é:
$ cat /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /home/buffhead/Sites
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
DocumentRoot /home/buffhead/Sites/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/buffhead/Sites/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
E conteúdo do novo DocumentRoot:
$ ls -l /home/buffhead/Sites/
total 4
-rw-r--r-- 1 root root 25 अक्टूबर 13 15:12 info.php