Configuration of lamp server: openSUSE 12.1, no GUI :)

Hi everyone,
I have myself confuzzled after attempting to get my “server” up and running. The machine is for software design and data analysis, and has no GUI installed. On the other hand, it also has to serve up files via Http, so I installed the lamp server when installing openSUSE. Apache is running, port 80 is open, and everything seems to be configured correctly; however, I cannot get the mundane (yet sorely needed) “It Works” page. I’ve problem solved this in the past, but always using a GUI. Searching the forums hasn’t led to any useful information, though I know this is a common question. I can post any configuration information needed.

Thanks!

Without getting complicated, this is my few simple steps to using Apache… Note when I’m dealing with highly disposable websites for simple Dev, I don’t want to be configuring virtual websites and more…

  1. Install with all the necessary prerequisites. The LAMP pattern in YAST Install is fine for most typical, simple use.

  2. Verify services are running, if not sure then verify services are all set to start automatically (on boot) and reboot

  3. Apache by default should point to

/srv/www/htdocs/indes.html

Open a web browser to localhost and if localhost is configured correctly, your index.html should display.

  1. I typically replace the default index.html with something like “It Works!”
    rt o
  2. Now, anytime you want to test a website or webcontent, replace or place in the htdocs folder accordingly (no reboot or restart of services required)

Some variations on (5) are

  • Replace index.html, this will mean that just opening a web browser will default to that page and run code automatically.
  • Do not replace index.html, the new website root might use another filename like “index2.html” or “default.html”. Now opening a webbrowser to this new content requires specifying the page name (eg http://localhost/index2.html)’
  • Create a subfolder, this will create a web subdirectory, eg place all new content in a folder called “newweb” Now you need to open a webbrowser to “http://newweb/index.html

So, swap your code as much as you want!

HTH,
TSU

And as an addition to @tsu2’s advice, I see no reason why you need a GUI. for this. When you need YaST, use it, it will show the NCurses interface. And for the rest you ue the editor of your choice (probable vi/vim).

xveinx wrote:
> Hi everyone,
> I have myself confuzzled after attempting to get my “server” up
> and running. The machine is for software design and data analysis, and
> has no GUI installed. On the other hand, it also has to serve up files
> via Http, so I installed the lamp server when installing openSUSE.
> Apache is running, port 80 is open, and everything seems to be
> configured correctly; however, I cannot get the mundane (yet sorely
> needed) “It Works” page. I’ve problem solved this in the past, but
> always using a GUI. Searching the forums hasn’t led to any useful
> information, though I know this is a common question. I can post any
> configuration information needed.

Well, as tsu2 says, is the HTTP server running?

If it is, what does its access and error log show?

You already receive several useful replies, so let me just add the
commands which should give some useful facts for us so that we do not
need to rely on a story but on computer facts.
To ensure apache is running show us the output from


martinh@ganymed:~> su -
Passwort:
ganymed:~ # rcapache2 status
redirecting to systemctl
apache2.service - apache
Loaded: loaded (/lib/systemd/system/apache2.service; disabled)
Active: inactive (dead)
CGroup: name=systemd:/system/apache2.service

as you see it is NOT running on my machine, in that case start it


ganymed:~ # rcapache2 start
redirecting to systemctl
ganymed:~ # rcapache2 status
redirecting to systemctl
apache2.service - apache
Loaded: loaded (/lib/systemd/system/apache2.service; disabled)
Active: active (running) since Wed, 03 Oct 2012 13:46:09
+0200; 4s ago
Process: 8682 ExecStart=/usr/sbin/start_apache2 -D SYSTEMD -k
start (code=exited, status=0/SUCCESS)
Main PID: 8703 (httpd2-prefork)
CGroup: name=systemd:/system/apache2.service
<snip>

which shows it now running. What I want to say is, these are facts and
not a story.
Next thing


martinh@ganymed:~> rpm -qf  /srv/www/htdocs/index.html
apache2-example-pages-2.2.22-4.7.1.x86_64

so that means the index.html (the famous “It works”) is only there if
you have the package apache2-example-pages installed.
Confirm this with


rpm -q apache2-example-pages #package installed?
ls -l /srv/www/htdocs/ #is there an index.html?
cat /srv/www/htdocs/index.html #what does it contain?

If it turns out that apache really runs and the example pages rpm is
installed and an index.html is in /srv/www/htdocs and you still do not
see the page: You might have a misconfiguration in apache itself.

Check on the local machine with telnet if port 80 is available


martinh@ganymed:~> telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET /index.html
<html><body><h1>It works!</h1></body></html>Connection closed by foreign
host.
martinh@ganymed:~>

(after the telnet command succeeded type the “GET /index.html” and press
enter, the rest is the html apache sends you back) or try to access it
with a text based web browser like lynx.
If that succeeds and access from outside not you have a firewall, dns or
similar issue.


PC: oS 12.2 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.5 | GeForce GT 420
ThinkPad E320: oS 12.2 x86_64 | i3@2.30GHz | 8GB | KDE 4.9.1 | HD 3000
eCAFE 800: oS 12.2 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10

Thank you for the replies all! I solved it by reconfiguring the firewall. It appears the port, though open via nmap, was open INT, but not EXT.