Re: Web page works with "php -S" but not with apache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 05/29/2018 04:05 PM, Mahmood Naderan wrote:

Consider the following apach2 config file on an Ubuntu 18.04 as below

root@web1:/var/www/html# cat /etc/apache2/sites-available/000-default.conf 
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/
<Directory "/var/www/html/">
     Options Indexes FollowSymLinks MultiViews
     AllowOverride All
     Order allow,deny
     allow from all
     Require all granted
</Directory>
LogLevel debug 
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

And the files are in /var as below

root@web1:/var/www/html# ls -lah
total 912K
drwxr-xr-x 19 root     root     4.0K مئی   29 15:12 .
drwxr-xr-3 root     root     4.0K مئی   27 14:37 ..
-rw-r--r--  1 www-data www-data 3.1K اوْکتوْ 14  2017 captcha.php
-rw-rw-r--  1 www-data www-data  38K اوْکتوْ 10  2016 CHANGELOG.txt
-rw-r--r--  1 www-data www-data 5.0K مئی   28  2017 e500.php
-rw-r--r--  1 www-data www-data 3.2K مئی   27 23:38 index.php
-rw-r--r--  1 www-data www-data 4.3K مئی   16 19:21 install_info.txt
drwxrwxr-2 www-data www-data 4.0K مئی   27 16:52 ow_core
drwxrwxr-2 www-data www-data 4.0K مئی   27 16:52 ow_cron
drwxrwxr-x 10 www-data www-data 4.0K مئی   27 16:52 ow_iis
drwxrwxr-2 www-data www-data 4.0K مئی   27 23:30 ow_includes
drwxrwxr-7 www-data www-data 4.0K مئی   27 16:52 ow_install
drwxrwxr-x 15 www-data www-data 4.0K مئی   27 16:52 ow_libraries
drwxrwxrwx  2 www-data www-data 4.0K مئی   16 19:33 ow_log
drwxrwxrwx  7 www-data www-data 4.0K مئی   16 19:33 ow_pluginfiles
drwxrwxr-x 31 www-data www-data 4.0K مئی   27 16:52 ow_plugins
drwxrwxr-4 www-data www-data 4.0K مئی   27 16:52 ow_smarty
drwxrwxr-4 www-data www-data 4.0K مئی   27 16:52 ow_static
drwxrwxr-4 www-data www-data 4.0K مئی   27 16:52 ow_system_plugins
drwxrwxr-3 www-data www-data 4.0K مئی   27 16:52 ow_themes
drwxrwxr-4 www-data www-data 4.0K مئی   27 16:52 ow_updates
drwxrwxrwx  4 www-data www-data 4.0K مئی   16 19:33 ow_userfiles
drwxrwxr-2 www-data www-data 4.0K مئی   27 16:52 ow_utilities
-rw-r--r--  1 www-data www-data  358 مئی   16 19:21 ow_version.xml
-rw-r--r--  1 www-data www-data 757K مئی   16 19:21 ReadMe.pdf
-rw-rw-r--  1 www-data www-data  718 دسامب 21  2016 robots.txt
drwxr-xr-2 root     root     4.0K مئی   29 15:12 shub
-rw-rw-r--  1 www-data www-data 1.5K مئی   23  2016 UPDATE.txt

The files are mounted as /var according to the fstab:

root@web1:/var/www/html# cat /etc/fstab | grep var
# /var was on /dev/sda5 during installation
UUID=c05e3e60-5916-4817-b8e7-f27a2681e42a /var            ext4    defaults        0       2

Form a remote machine when I enter http://w.x.y.z in firefox, I get the following error

The requested URL /install was not found on this server.

1. Note that you are requesting the default page http://w.x.y.z/(index.php), but the error message refers to http://w.x.y.z/install

On the other hand, when I run php -S localhost:8080 and enter http://localhost:8080 in firefox (local on the machine and not remote), I get the following output

root@webshub:/var/www/html# php -S localhost:8080
PHP 7.2.5-0ubuntu0.18.04.1 Development Server started at Tue May 29 22:56:54 2018
Listening on http://localhost:8080
Document root is /var/www/html
Press Ctrl-C to quit.
[Tue May 29 23:02:57 2018] 127.0.0.1:41380 [301]: /
[Tue May 29 23:02:57 2018] 127.0.0.1:41382 [301]: /install
[Tue May 29 23:02:57 2018] 127.0.0.1:41384 [200]: /install/rules
[Tue May 29 23:02:57 2018] 127.0.0.1:41386 [200]: /ow_install/view/style.css
[Tue May 29 23:02:57 2018] 127.0.0.1:41388 [200]: /ow_install/view/img/header.png
[Tue May 29 23:02:57 2018] 127.0.0.1:41390 [200]: /ow_install/view/img/logo.png

And that correctly shows the install page. So the question is, why I am not able to access the install page remotely?


2. No, that shows a directory, not a page, named "install"

 

 

Regards,

Mahmood


3. Check your error log to see what happens during your Apache request.

4. It would be helpful to know what package you are installing here. The user group for that package can probabaly help you.

Good luck.

- John



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux