Aqui está o que estou tentando fazer.
Eu tentei adicionar outra pasta ao apache e recebi o seguinte erro ao tentar acessar o testing/index.html
.
A ideia é que eu gostaria de ter para cada cliente uma pasta como /home/neagoe/Work/InterWebs/Projects/[PROJECT NAME]/CustomerProjects/website/dist
.
Forbidden
You don't have permission to access /index.html on this server.
Apache/2.2.22 (Ubuntu) Server at testing Port 80
Aqui estão os passos que segui:
Passo 1:
sudo chmod a+x /home/neagoe/Work/InterWebs/Projects/testing/CustomerProjects/website/dist
Passo 2:
sudo chown -R www-data:www-data /home/neagoe/Work/InterWebs/Projects/testing/CustomerProjects/website/dist
sudo chmod -R 775 /home/neagoe/Work/InterWebs/Projects/testing/CustomerProjects/website/dist
Passo 3:
sudo adduser $USER www-data
Passo 4:
sudo a2enmod userdir
Passo 5:
sudo cp /etc/apache/sites-available/default /etc/apache/sites-available/testing
Eu editei o arquivo /etc/apache/sites-available/testing
, então ficou assim:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName testing
DocumentRoot /home/neagoe/Work/InterWebs/Projects/testing/CustomerProjects/website/dist
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/neagoe/Work/InterWebs/Projects/testing/CustomerProjects/website/dist/ >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Passo 6:
Eu editei os hosts ("/ etc / hosts") para que fique assim:
127.0.0.1 localhost
127.0.0.1 testing
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Passo 7:
sudo a2ensite testing
sudo service apache2 restart
Eu procurei por cerca de duas horas na internet, mas não consigo descobrir o que deu errado.
Todas as páginas que encontrei seguindo os mesmos passos descritos acima.
Eu sei que existem perguntas semelhantes aqui na internet, mas a resposta é mudar a permissão para o diretório que eu fiz no Step2 .
Lamento se isso é realmente uma duplicata, mas não consegui encontrar a resposta certa.
Obrigado!
PS. Eu perguntei isso também no AskUbuntu, mas não obtive respostas, então estou tentando a sorte aqui.
Editar:
Não há muito no log de erros ou no log de acesso.
No access.log
:
::1 - - [10/Aug/2013:11:23:28 +0300] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [10/Aug/2013:11:23:29 +0300] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [10/Aug/2013:11:23:31 +0300] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [10/Aug/2013:11:23:32 +0300] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [10/Aug/2013:11:23:33 +0300] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [10/Aug/2013:11:23:34 +0300] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [10/Aug/2013:11:23:35 +0300] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
127.0.0.1 - - [10/Aug/2013:11:23:23 +0300] "POST /wordpress-testing/wp-cron.php?doing_wp_cron=1376123003.7026669979095458984375 HTTP/1.0" 200 705 "-" "WordPress/3.6; http://localhost/wordpress-testing"
::1 - - [10/Aug/2013:11:23:36 +0300] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [10/Aug/2013:11:23:37 +0300] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
::1 - - [10/Aug/2013:11:23:38 +0300] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)"
127.0.0.1 - - [10/Aug/2013:11:31:32 +0300] "GET /index.html HTTP/1.1" 200 485 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0"
A última linha é repetida por cerca de 200 linhas.
No error.log
:
1. Essas linhas se repetem de tempos em tempos.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525 /msql.so' - /usr/lib/php5/20100525/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Sat Aug 10 13:06:42 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.9-4ubuntu2.2 configured -- resuming normal operations
[Sat Aug 10 13:07:36 2013] [notice] caught SIGTERM, shutting down
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/msql.so' - /usr/lib/php5/20100525/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Sat Aug 10 13:07:37 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.9-4ubuntu2.2 configured -- resuming normal operations
2. E esse é o erro predominante. (centenas de linhas)
[Sat Aug 10 13:07:40 2013] [error] [client 127.0.0.1] (13)Permission denied: access to /index.html denied