LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache Server help needed (https://www.linuxquestions.org/questions/linux-newbie-8/apache-server-help-needed-601569/)

TheLaughingCorpse 11-21-2007 07:37 PM

Apache Server help needed
 
I installed Apache on this computer, it's Mandriva 2008 I was running Mandriva 2006, and I never had this error before I don't think.
Anyway when I try to start the service I get this.

[root@Mandriva austin]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]
Also I was trying to put phpBB forums on there, but when I put the files in a /forums/ directory, when I try to connect from my other computer the connection is timed out. I could view the index.html file from the home directory.

When I tried to view it on here I got a permission denied error or no index file. I added index.php to the httpd.conf file and I get the code, but it doesn't do what it's supposed to.

I don't even think I should be posting this here because it doesn't concern linux too much I think...

but if someone could help
Thank you

indeliblestamp 11-21-2007 11:11 PM

Just re-check your httpd.conf file. Make sure the lines Listen and ServerName are not commented out. Anyway since you're able to view your index.php remotely, you can safely ignore the warning if you want.
If index.php is showing the code, its possible you haven't installed php, or you haven't configured apache to load the php module.
What is the output of locate libphp?

riseinarms 11-22-2007 08:46 AM

Ah, thank you ServerName was commented out. It isn't getting the error.

I looked up more on the php issue and found out it needed to be installed. I looked on Google and downloaded the newest version of php. I haven't installed it yet and I'm hoping I can, this is the output though...

[austin@Mandriva ~]$ locate libphp
/home/austin/Desktop/php-5.2.5/sapi/apache/libphp5.module.in
/home/austin/Desktop/php-5.2.5/sapi/apache_hooks/libphp5.module.in

I'm trying to use the documentation from the php site, but if you know an easier one then would you let me know?

indeliblestamp 11-22-2007 09:54 AM

Are you the same guy who asked the question? Why two accounts? :)
Anyway, I think php configuation in Apache might differ across distros, but here is what mine looks like anyway:

There's a line in httpd.conf that says:
Code:

# Uncomment the following line to enable PHP:
#
#Include /etc/httpd/mod_php.conf

And in mod_php.conf, the required LoadModule line is as follows:
Code:

LoadModule php5_module lib/httpd/modules/libphp5.so
And the only other uncommented line in that file is:
Code:

AddType application/x-httpd-php .php
(this is the piece that will make your php page appear correctly instead of as code.
I guess I asked you for the locate libphp output because the name and path often differs (libphp4so, libphp5.so, etc) depending on the version or something, & I remember struggling with minor problems like that when I was configuring these things once. As long as you enter it correctly in the LoadModule line you'll have no problems.

riseinarms 11-22-2007 10:55 AM

Yeah, same guy. I was wondering why I wasn't getting e-mail responses and I found out I had another account. :D

Well the php I downloaded you have to compile, and the tutorial I was looking at was really confusing.

I tried doing what you said, but it isn't working. It's saying the files don't exist, and I tried that command, and there is no output anymore.

indeliblestamp 11-22-2007 11:49 AM

Well basically the libphp5.so file will appear only after you compile and install the php that you downloaded.
(The only time I installed php myself, I did the entire (L)AMP server installation from source: apache2, mysql and php) Maybe you should consider removing apache through your package manager and installing it from source using the steps given here. Because I'm not sure what arguments it might have been configured with by default.
Or perhaps someone experienced could give an easier solution.

Edit: If you are planning to remove apache and reinstall it from source, please take a backup of your html directory first (also httpd.conf). It shouldn't get removed, but better safe than sorry.

riseinarms 11-22-2007 02:22 PM

I'm going to try remove the package and trying that. I don't have anything on there as of now so I don't need to make a backup. Thank you for your help.

riseinarms 11-22-2007 03:44 PM

ok I get this error:

configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore!
[root@Mandriva php-5.2.5]# make
make: *** No targets specified and no makefile found. Stop.

indeliblestamp 11-22-2007 10:20 PM

Hmm. Do you have mysql installed already? If not, you should install that too if you want php+mysql in apache.
If you do have mysql installed, make sure you give the correct path to its location while running the ./configure script.
A quick google shows that one user had to give it as:
Code:

./configure -with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql
But it could very well be --with-mysql=/usr/mysql (instead of /usr/local/mysql), so make sure you verify that path before running the php configure script.

riseinarms 11-22-2007 10:53 PM

I got past that part now, it said with PHP5 that the MySQL headers aren't included anymore or something like that. I tried to configure PHP without MySQL and apparently there is an issue with PHP and there's some sort of error. Which sucks. I tried to install PHP4 but there was an error with that too, and the support is going down for that version.

I guess I'll have to wait a bit until the fix the new version... :(

indeliblestamp 11-23-2007 01:19 AM

Okay, if you don't mind could you try one last option? I just did a quick search and found xampp, an all-in-one package with apache, php, sql and several other things. The install steps in that link look pretty simple, and it should sit (in /opt) completely independent of your existing apache/mysql/other installations.
So can you try that out and see how it goes?

riseinarms 11-23-2007 01:31 PM

I tried the package you suggested. It worked great. I have it all set up and phpbb forums on there.

You wouldn't happen to know how to set up a domain name would you? haha

indeliblestamp 11-24-2007 05:08 AM

Phew, at last! Glad it worked. Never done the domain name thingie, guess you should search around a bit for that. If you don't have a static public IP address, you might want to google for dynamic dns. All the best with your site..


All times are GMT -5. The time now is 11:49 AM.