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 03-09-2011, 03:15 AM   #1
rajnikhil
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Rep: Reputation: 0
Set up LAMP server to control database over the internet


Hi All,

I want to create a database (using mysql) and control it over the net using phpmyadmin.

I'm using basic slackware install (only command line to keep RAM req down) which is installed as a guest OS in virtualbox.

I've downloaded and installed the httpd packages and made the set-up as mentioned here: http://connie.slackware.com/~mrgobli...kware-lamp.php

at the end of this page it says to open browser and type 'http://localhost/'. I tried this out from the host OS but it didn't work.

I guess localhost is the name of the server, I replaced it with my box's name and tried to ping it but it didn't work. Am I doing it correctly?

I'm not sure if I've got all the settings correct. Could someone please help me out in setting up this complete LAMP server. Please let me know if there is any more information you require.

Thanks in advance!!!
 
Old 03-09-2011, 08:04 PM   #2
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by rajnikhil View Post
at the end of this page it says to open browser and type 'http://localhost/'. I tried this out from the host OS but it didn't work.

I guess localhost is the name of the server, I replaced it with my box's name and tried to ping it but it didn't work. Am I doing it correctly?
Hi,

http://en.wikipedia.org/wiki/Localhost

When you access http://localhost from host OS, it means you access to itself, not guest OS.

Which is networking between host and guest OS: NAT, bridged, ...?
 
1 members found this post helpful.
Old 03-10-2011, 12:59 AM   #3
rajnikhil
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Hi,

I am able to get the page over the net now, gave the dynamic IP domain name. My next step was to enable PHP in order to be able to work with PhpMyAdmin. I uncommented the '/etc/httpd/mod_php.conf' line in the httpd conf file.

Now when I restart the server it gives me the following error:

httpd: Syntax error on line 478 of /etc/httpd/httpd.conf: Syntax error on line 6 of /etc/httpd/mod_php.conf: Cannot load /usr/lib64/httpd/modules/libphp5.so into server: /usr/lib64/libxml2.so.2: symbol gzopen64, version ZLIB_1.2.3.3 not defined in file libz.so.1 with link time reference

when I checked for it i.e. ldd libphp5.so, at the beginning it says:

./libphp5.so: /usr/lib64/libz.so.1: no version information available (required by /usr/lib64/libxml2.so.2)

Not sure what is happening here and how to correct it.

Thanks in advance for the help.
 
Old 03-10-2011, 03:08 AM   #4
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
Which distro are you running on guest OS?
 
Old 03-10-2011, 04:41 AM   #5
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
You mentioned your first post that you are using Slackware. Slackware's package management system is different than most in that it does not automatically resolve the dependencies for you and the error messages look like you are missing some of the libraries that PHP depends on. One of the members in the Slackware forum here at LQ, 2handband, has written some excellent tutorials on Slackware, including one on the package management system. Here is a link to the package management page. I would recommend you review it and then look at getting your PHP either from Slackbuilds (along with the dependencies first, which it will spell out), or use Alien Bob's repositories.
 
Old 03-10-2011, 02:58 PM   #6
rajnikhil
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks Noway2. That's resolved now and is hopefully running correctly. I created an index.php doc in the documentroot but when I access it, an error is displayed which says '403 forbidden you don't have permission to access /index.php on this server.'

Could you please help me out with this as to getting this thing working.

Thanks in advance!
 
Old 03-10-2011, 03:47 PM   #7
rajnikhil
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Original Poster
Rep: Reputation: 0
just to mention, in the DirectoryIndex index.php is already mentioned so that is surely not the root of the problem.
 
Old 03-10-2011, 04:17 PM   #8
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
If you are running Slackware, the default document root is /var/www/htdocs, or /srv/http/htdocs as a link. The folders and files need appropriate permissions. I recommend read-write by root (only) and read by others. Your httpd process needs to be able to read the files. Verify this with an ls -a.
 
Old 03-10-2011, 11:18 PM   #9
rajnikhil
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Like you said, my document root is /srv/httpd/htdocs and I was logged in as root when I wrote that index.php file. Then when I tried to access index.php (using lynx), while staying as root, I get the error I mentioned in the previous mail. When I login as another user or try to access the page from a browser in the host OS I get the error '404 Not Found: The Requested URL /index.php was not found on this server'. I also tried the ls -a step after going to the /src/httpd/htdocs and the result is same irrespective of who I am logged in as (root or other user). I guess then that the issue is with permission for folders and files.

Not quite sure how to do this, would be great if you could help me out (with a little detailed steps)

Again, thanks in advance.
 
Old 03-12-2011, 12:24 PM   #10
rajnikhil
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Ok slight improvement in the situation here. I no more get the 403 forbidden msg, it was an issue with the permissions and I got it resolved via chmod commands but I am still facing the 404 File not found error, now also when I am logged in as root. I also changed the document root in vhosts.conf file to point to srv/httpd/htdocs but it didn't pay off.

Can someone please help me out.
 
Old 03-12-2011, 02:31 PM   #11
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Changing the permissions with chmod is the correct way to go.

A couple of things on document root, first make sure there is NOT a trailing slash on the end. Second, be sure you restart apache after making changes to the configuration file.

If you are starting with index.php, it might be easier to verify with index.html. If that pages comes up, it may be an indication of a problem with the PHP installation. You will probably want to add index.php to your directory index directive which will tell Apache to look for this file. By default it will only look for index.html.

With slackware, I don't think it uses the vhost-conf (in the /extra) directory by default either. You may need to make sure that it gets included at the very least. The configuration files are well commented, so there are probably some directions. I would start with the document root in httpd.conf to get things working and then try adding vhosts.
 
  


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
[SOLVED] LAMP question. How to create new database from PHP, SQL zubat123 Linux - Server 2 11-05-2010 01:38 AM
LXer: Ubuntu LAMP Server MySQL Database Configuration LXer Syndicated Linux News 0 11-19-2009 01:30 AM
Building a LAMP server with SSL autheentication and a control panel rooktakespawn Fedora - Installation 3 11-06-2009 04:50 AM
LXer: How To Set Up A Web-, Mail-, And Database Server With SuSE 10.1 LXer Syndicated Linux News 0 05-31-2006 12:54 PM
how i can set my windows client to use my mysql server as database sandeepchau123 Linux - Networking 0 11-20-2003 06:34 AM

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

All times are GMT -5. The time now is 03:38 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