Thursday, 6 February 2020

windows - VM running CentOS, can ping but can't access web server


I've been trying to set up a CentOS server for the first time (ever setting up a Linux server). The installation went fine, I installed LAMPP (and the required dependencies for x86), used the lampp security tool, and went to http://192.168.0.112:8888/ using elinks.


So far so good... But then I wanted to access the server from the other computers in my network (including the host of the VM). But I can't get it to work and keep getting 404's...


Note that I have another webserver running on this network (on port 80), so I changed Listen 80 to Listen 8888 in httpd.conf and forwarded 8888 in my router to the IP from the CentOS installation (static: 192.168.0.112, according to ifconfig).


Ping 192.168.0.112 returns:


Ping statistics for 192.168.0.112:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

Server details:



  • CentOS 6.5 minimal, installed from .iso

  • LAMPP 1.8.1 (via wget from apachefriends.org)


Host details:



  • Windows 8.1 x64

  • VirtualBox is using a Bridged Network Adapter (translated from Dutch: Netwerk bridge adapter)


Any ideas on how to fix this issue? I'm relatively new to networking and server as I'm a front-end developer myself, but I really want to get into back-end stuff.


It's getting really late now, so I'm off to bed. Hopefully I get some good insights in how networking/CentOS works in the morning!


Thanks in advance.



Answer



More than likely is a virtualhost configuration inside apache. There is a section in there that will say "allow from [something]". Make sure it says "allow from all".


Here is what mine looks like;



Options FollowSymLinks
AllowOverride AuthConfig FileInfo Limit
Order allow,deny
allow from all


My personal opinion is to not use xampp at all. You are actually making things more difficult. Just use the native packages in CentOS. Here is a good tutorial (from a quick google search)


https://www.digitalocean.com/community/articles/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-6


Or, you can install Ubuntu Server and there is an option during the install phase that you can check to install LAMP. It will download and install all of the packages for you.


Good luck.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...