LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-02-2012, 01:47 PM   #1
theBram
LQ Newbie
 
Registered: Nov 2012
Posts: 5

Rep: Reputation: Disabled
Apache server works randomly (Ubuntu 12.04 LAMP)


Hi

Today I installed apache, php, mysql on a VPS (ubuntu 12.04).
I already connected one of my domains to the ip of my VPS.
But when I navigate to my domain, I see sometimes this:

OK (the content that should be displayed)

but when I refresh or wait a few minutes I see this content:

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.


It's very randomly, it's like apache doesn't know what directory to choose.

Does anyone recognize this problem?

Thanks in advance

Bram

EDIT:

the commands I used after virtual machine installation are:

adduser bram
passwd bram
sudo apt-get update
sudo apt-get upgrade --show-upgraded
sudo apt-get install apache2 apache2-doc apache2-utils
sudo apt-get install libapache2-mod-php5 php5
sudo apt-get install php-pear php5-xcache php5-suhosin
sudo apt-get install php5-mysql
a2dissite default
service apache2 reload
cd /etc/apache2/sites-available
nano mydomain.com

<VirtualHost *:80>
ServerAdmin webmaster@mydomain.com
ServerName mydomain.com
ServerAlias www.mydomain.com
DirectoryIndex index.php index.html
DocumentRoot /var/www/mydomain.com/public_html
ErrorLog /var/www/mydomain.com/logs/error.log
CustomLog /var/www/mydomain.com/logs/access.log combined
</VirtualHost>

mkdir -p /var/www/mydomain.com/public_html
mkdir /var/www/mydomain.com/logs
a2ensite mydomain.com
service apache2 restart

Last edited by theBram; 11-02-2012 at 02:01 PM. Reason: typo
 
Old 11-02-2012, 04:41 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
You are saying that you "connected" the server with the domain name.... you mean you set up dns? Are you completely sure dns is resolving the name to the right IP? Perhaps it's resolving to another IP (server with the default apache message) and that's why the response is not the expected one.

Perhaps a little fun with a sniffer to make sure the server you think is responding is the actual server that is responding?
 
Old 11-02-2012, 04:43 PM   #3
theBram
LQ Newbie
 
Registered: Nov 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Yes absolutely, I have the same problem when I use my IP as url, so it can't be the problem.
 
Old 11-02-2012, 04:51 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
And every single time you are requesting exactly the same URI, right? Then it's either something fancy in the apache config or a bug.
 
Old 11-02-2012, 04:56 PM   #5
theBram
LQ Newbie
 
Registered: Nov 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Yes, exactly the same URI. It changes every +- 3 to 5 minutes to working (php file with echo "ok") /not working

Could It have something to do with the network adapters?

Last edited by theBram; 11-03-2012 at 03:27 AM.
 
Old 11-03-2012, 02:20 PM   #6
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
(php file with echo "ok") /not working
I could not get your question wright .I Guess php is not working,if that the case you have done all installation&php wright,check whether you have enable php5 module

sudo a2enmod php5
sudo apache2ctl -M -->check whether php5 module is included


Quote:
It's very randomly, it's like apache doesn't know what directory to choose.

Does anyone recognize this problem?
Have you placed all static content to the following path to make apache to listen the static content .DocumentRoot /var/www/mydomain.com/public_html
 
Old 11-03-2012, 05:00 PM   #7
theBram
LQ Newbie
 
Registered: Nov 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
It has nothing to do with php, I think it's a problem with the hypervisor, when I shutdown my virtual machine, my IP/domain still responds, but only with the 'it works' page, so I think my hosting provider did something wrong with the network adapters. (two virtual machines connected to one IP, I think a deleted virtual machine is still active but not visible)

Last edited by theBram; 11-03-2012 at 05:02 PM.
 
Old 11-04-2012, 01:50 PM   #8
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Told you to use one sniffer.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ubuntu LAMP server, can't access site remotely, locally works by local ip and wan weylin Linux - Newbie 8 04-25-2012 06:37 AM
How can I edit files remotely from LAMP Ubuntu Server with Ubuntu Desktop? pyrospade Linux - Server 4 11-27-2010 03:07 AM
lamp server communication goes on and off (apache, sshd, nx-server, mysql) jonjon Linux - Server 2 06-07-2010 11:23 AM
LAMP (linux-apache-mysql-php) server from scratch twlilinux Linux - Server 3 06-11-2008 12:35 AM
Setting up Ubuntu LAMP Server for local web server sewmyheadon Linux - Newbie 5 02-11-2007 02:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration