Why not open the site from the outside IP?

Good evening.

Faced with such a problem. There is a server on a bunch of LAMP, based On CentOS 7. For some reason the website opens normally if you use the name or internal server IP, but if you use an external, it does not work.
Forwarding is configured properly (checked on the SSH service). What could be the reason?
July 2nd 19 at 13:37
1 answer
July 2nd 19 at 13:39
Solution
in the LAMP settings can be registered virtual host for local address and DNS name, and not spelled out to an external address (or external it goes to an empty directory)

ServerName tours.msk
ServerAlias www.tours.msk
DocumentRoot /var/www/tours.msk

Options FollowSymLinks
AllowOverride All
Require all granted

ErrorLog /var/log/apache/error.log
CustomLog /var/log/apache/access.log common
php_admin_value date.timezone 'Europe/Moscow'
php_admin_value max_execution_time 60
- Jovani.Kuphal commented on July 2nd 19 at 13:42
That is, the virtual host is not being used?

How did you check the forwarding?
Can propose correctly ssh and HTTP/HTTPS not proposely? - Jeff28 commented on July 2nd 19 at 13:45
There's even a Cisco, and TP-LINK 941. Nowhere to be mistaken just.
https://goo.gl/tIHvwK - Jovani.Kuphal commented on July 2nd 19 at 13:48
https use?

Listen looks like? - Jeff28 commented on July 2nd 19 at 13:51
Go to http/vneshnjaja:3555
? - Jeff28 commented on July 2nd 19 at 13:54
: telnet'GSI.



And so on. This is when connecting to the external address via telnet is specified in the forwarding port and pressing Enter. - Jovani.Kuphal commented on July 2nd 19 at 13:57
: Don't use HTTPS. Turning to the external address standard bump browser in the form https://goo.gl/prVig5 - Jovani.Kuphal commented on July 2nd 19 at 14:00
You have the website problem.

I went in via telnet to your external address, and got a page where the full reference type

192.168.0.102/wp-content/...

That is, the engine is configured to 192.168.0.102 and gives a page that tries to load content from 192.168.0.102. - Jeff28 commented on July 2nd 19 at 14:03
Changed. In fact, nothing has changed :( just In case checked via mobile Internet - the same thing. - Jovani.Kuphal commented on July 2nd 19 at 14:06
C:\>wget 2.92.58.216:3555
--2016-11-28 21:19:17-- 2.92.58.216:3555
Connecting to 2.92.58.216:3555... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: 2.92.58.216 [following]
--2016-11-28 21:19:18-- 2.92.58.216
Connecting to 2.92.58.216:80...

You have a redirect on port 80.
I don't know how exactly you configure the base_url in your site, but it is wrong, not relative. - Jeff28 commented on July 2nd 19 at 14:09
: VirtualHost *
ServerName tours.msk
ServerAlias www.tours.msk
DocumentRoot /var/www/tours.msk

Options FollowSymLinks
AllowOverride All
Require all granted

ErrorLog /var/log/apache/error.log
CustomLog /var/log/apache/access.log common
php_admin_value date.timezone 'Europe/Moscow'
php_admin_value max_execution_time 60
/VirtualHost

Right now you have configured VirtualHost? There was *:80, but I fixed to just *. Nothing has changed. Without braces, because the Toaster line with them not showing. - Jovani.Kuphal commented on July 2nd 19 at 14:12
No, it's in the engine somehow for all include it substitutes the address with 80 port, check engine.
Well, use the utility wget to see what comes - Jeff28 commented on July 2nd 19 at 14:15
: Thank you, now try to understand )) - Jovani.Kuphal commented on July 2nd 19 at 14:18
In General, I found a temporary solution. Changed the connection port for remote management on the router, and then forwarding directly port 80. In principle, all that was required for external testing, so the problem can be considered solved. Though it is interesting to see what the problem was. - Jovani.Kuphal commented on July 2nd 19 at 14:21

Find more questions by tags ApacheCentOS