Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-02-2012, 02:47 PM
|
#1
|
LQ Newbie
Registered: Nov 2012
Posts: 5
Rep:
|
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 03:01 PM.
Reason: typo
|
|
|
11-02-2012, 05:41 PM
|
#2
|
Senior Member
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Rep:
|
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?
|
|
|
11-02-2012, 05:43 PM
|
#3
|
LQ Newbie
Registered: Nov 2012
Posts: 5
Original Poster
Rep:
|
Yes absolutely, I have the same problem when I use my IP as url, so it can't be the problem.
|
|
|
11-02-2012, 05:51 PM
|
#4
|
Senior Member
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Rep:
|
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.
|
|
|
11-02-2012, 05:56 PM
|
#5
|
LQ Newbie
Registered: Nov 2012
Posts: 5
Original Poster
Rep:
|
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 04:27 AM.
|
|
|
11-03-2012, 03:20 PM
|
#6
|
Member
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Rep:
|
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
|
|
|
11-03-2012, 06:00 PM
|
#7
|
LQ Newbie
Registered: Nov 2012
Posts: 5
Original Poster
Rep:
|
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 06:02 PM.
|
|
|
11-04-2012, 02:50 PM
|
#8
|
Senior Member
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Rep:
|
Told you to use one sniffer.
|
|
|
All times are GMT -5. The time now is 01:20 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|