2

So at work I've just kind of taken over the servers and am suppose to set up a MapServer. I'm fairly new to all this web server stuff. I was trying to run a bin file and know I have to run it from the web server and not just typing in file/// in a browser. All the Apache files are on the system but I'm not sure if it's actually set up and running. I'm on Linux, CentOS.

When I type in "localhost" I just get a message saying Firefox was unable to connect to the server. I went to whatismyip.com to get my IP Address and when I go there I get a page displaying some text about the company, so there is an html file somewhere I guess? Would this be for the web server running on my computer? If so, I cannot find this html file. I checked the default folder in /var/www/html but it's empty...

So I just don't know what file I'm accessing when I type in my IP. How do I know if Apache is running properly and where can I find where I need to upload files to access them via the http server?

edit: don't know if this really matters, but the server wasn't set up on the machine I'm using. But I do have root access to the root files where all the apache files are located. Maybe I shouldn't be using the IP address of my computer though? I'm not sure if this matters.

Thanks!

closed as off topic by mulaz, MDMarra, Wesley, Bryan, mdpc Jun 6 '13 at 16:19

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What is a MapServer? From the description, it sounds like you are setting up a LAMP server. – spuder Jun 6 '13 at 15:30
  • 3
    Please don't take this the wrong way: If you can't determine if Apache (or any other web server) is running on your system you're in WAY over your head. You need to talk to your boss and get an actual sysadmin in, at least until you've learned the basics. – voretaq7 Jun 6 '13 at 15:41
  • In regards to what is a mapserver, see: mapserver.org – Danny Jun 6 '13 at 15:47
  • 1
    Voretaq7, not taken the wrong way haha. I do understand I am in over my head. This is just a summer internship and my boss told me he knows I'm not qualified for this but it'll be a good learning experience. I am working with someone over me that has a lot of experience with this stuff, but he is out of office this week so I'm on my own and am just trying to get done what I can. – Danny Jun 6 '13 at 15:51
  • @Danny OK - as long as there's someone there you can turn to for the basics. Server Fault can do a lot of things, but we can't take someone from zero to qualified sysadmin (at least not without the risk of substantial damage in the process - either to the aspiring admin or the environment they're working in :-) – voretaq7 Jun 6 '13 at 16:19
9

To test if your web server is running properly:

Check that apache is running

sudo service httpd status

Create a test web page and put it into /var/www/index.html of your server

<html>
    <head>
    </head>
    <body>
       <h2>This is a test</h2>
    </body>
</html>

Find the ip address if your server

ifconfig

Paste the server ip address into firefox on your laptop.

If everything is working properly, you should see "This is a test" in firefox.

These instructions only work on Cent OS. Ubuntu/Debian use different package names and file locations.

If you are new to LAMP, I would highly recommend setting up a turn key solution.

http://www.turnkeylinux.org/lampstack

  • I get the message "httpd is stopped" when trying the service httpd status. Does this mean Apache is not installed or is there just a quick command to turn it on? Also, ifconfig gave a long list, which address would I want to put into the browser? The inet address? – Danny Jun 6 '13 at 15:40
  • Yes, apache is stopped. Run 'service httpd start'. The ip address you will want to enter is most likely eth0. If your server has multiple network cards, you will have to check with your network admin to find which network is on the same subnet. – spuder Jun 6 '13 at 15:41
  • Well suddenly when I go to localhost in my browser it works... Not sure if something you had me try changed that. For now it is just the default Apache 2 Test Page saying it is working properly. – Danny Jun 6 '13 at 15:53
  • Update: created the html document you provided the code for and it works properly. Thanks man. – Danny Jun 6 '13 at 15:58
0

In centos, you can run this as root

service httpd status

it will tell you whether it is running, or even installed.

if not installed, you need to install it

yum install httpd

configure and then service httpd start (chkconfig httpd on to make sure it starts automatically)

  • I tried doing "service httpd status" in the terminal (I think that's what you were saying to do) but it just says "service: command not found" The /etc/httpd/conf/httpd.conf file does exist though. I don't know if that is of any help. – Danny Jun 6 '13 at 15:21
  • are you root? you need to be root to run this command. if you still have problems, then try /etc/init.d/httpd status – johnshen64 Jun 6 '13 at 15:23
  • Yes. I am root. When I typed /etc/init.d/httpd status it says "httpd is stopped" I have a feeling this is bad haha. How do I fix this? – Danny Jun 6 '13 at 15:25
  • try /etc/init.d/httpd start and look in /var/log/httpd error log to see what is prevent it to work. you would need to troubleshoot. if it is not something simple (such as missing a required file), you likely would need to get some professional help, as then it will not be a simple question any more. – johnshen64 Jun 6 '13 at 15:28
  • I get the message: Starting httpd: httpd: apr_sockaddr_info_get() failed for new-host-698 httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName – Danny Jun 6 '13 at 15:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.