Welcome to the Linux Foundation Forum!

Apache/php installation

Hi, thanks for taking time.

I've installed apache on Ubuntu 10.04 LTS. Primary configuration is ok and I can view localhost in firefox, but:

I don't have permission to my NTFS drive where my .php webfiles reside, therefore I get "403 Forbidden" for my /media/T0/ folder, but there's no problem with my home folder, for example.

On the other hand, I'm facing a problem in compiling php, where "sudo ./configure" tells me that I don't have libxml2 on my system, while it's source is there in the php source folder, under ext/libxml directory.

Would appreciate your helps folks, thanks so much!

Comments

  • mfillpot
    mfillpot Posts: 2,177
    Re: Apache/NTFS
    It sounds like a file rights issue.
    What values are in the User, Group and DocumentRoot values in your httpd.conf file? Also what are the rights of the files and directories that you wish to have available to apache?

    Re: PHP
    Generally the files within one package source code that refer to a dependent application are the code file meant to make the connection between the applications, not the source code for the actual dependent application. You have to have the compile libxml2 libraries installed on your system to fully compile php.
  • gomer
    gomer Posts: 158
    for libxml2, check to make sure you have both packacges libxml2 and libxml2-dev installed.

    For the NTFS permissions issue, check that the www-data user has read and execute access to the files and folders.
  • ActiveX
    ActiveX Posts: 59
    thanks but I also need to ask these: first: How should I check and change the permissions ? (I'm a windows user, new to linux)

    and how is the process of installing php on apache if you happen to know? The instructions in php documentation are a little ambiguous for me.

    and if possible, tell me about linux directory structure. I use Ubuntu 10.04 LTS Desktop. I don't know which directory is for what, and how can I handle with directories that I don't have access/write permission for.
  • Universe
    Universe Posts: 3
    Woooo!!! you need to learn from scratch man. Grab a book and start reading.
  • gomer
    gomer Posts: 158
    Well, first, see who apache is running as. "ps auxw | egrep 'apache|http'"
    Then do ls -ld and ls -l on the directory where the files are.

    Do you understand Linux / Unix file permissions? The "-rw-r--r-- " stuff at the beginning of a directory listing from an ls -l? If not, then I suggest reading:
    http://www.dartmouth.edu/~rc/help/faq/permissions.html

    For installing php ... well, if you use the package repository, it's fairly easy. Just use synaptic, or aptitude, or apt-get, etc.
    If you install the following package, all the needed dependencies should get you where you need to be: libapache2-mod-php5
    If you want to install PHP and Apache from scratch, then you are going to have to do some reading. The INSTALL and README files for both apache and mod-php are not too bad. Essentially, you will need to build and install PHP. Then you will need to build Apache, but you will need to tell the apache install scripts to also build and install mod-php. Then you should be ok to go.

    If you want to know about the directory layout, then thes following 2 links are good to read:
    http://tldp.org/LDP/intro-linux/html/sect_03_01.html
    and
    http://www.pathname.com/fhs/
  • ActiveX
    ActiveX Posts: 59
    (Of course! However, I also consider my extremely fast learning ability and will start soon!)
  • ActiveX
    ActiveX Posts: 59
    I'm compiling all of the packages from scratch, I download packages from their websites. I use Synaptic for applications such as games etc.

    I seem to have found the problem. I need to recompile apache with --enable-so and then add php support to it.

    I have another question: I download packages from their sites. There are lots of C/C++ files in different directories there, besides makefile, configure & etc. Ain't those file sources of softwares? while many sources I find in "modules" directory in all of those packages seem to be the source code for the softwares. is it so?
  • marc
    marc Posts: 647
    ActiveX wrote:
    I have another question: I download packages from their sites. There are lots of C/C++ files in different directories there, besides makefile, configure & etc. Ain't those file sources of softwares? while many sources I find in "modules" directory in all of those packages seem to be the source code for the softwares. is it so?

    I do not understand you.

    C/C++ files are usually software code, yes. What's the question?
  • ActiveX
    ActiveX Posts: 59
    Marc, check this (Re PHP Part):

    mfillpot wrote:
    Re: Apache/NTFS
    It sounds like a file rights issue.
    What values are in the User, Group and DocumentRoot values in your httpd.conf file? Also what are the rights of the files and directories that you wish to have available to apache?

    Re: PHP
    Generally the files within one package source code that refer to a dependent application are the code file meant to make the connection between the applications, not the source code for the actual dependent application. You have to have the compile libxml2 libraries installed on your system to fully compile php.

    Maybe mfillpot is saying something that I don't understand, but what I get from his reply is that the files inside a package can not necessarily be the source code of the program. But I find .cpp files that seem to belong to the package, as of in "/ext" or "/main" directories under php package. Ain't those files the source codes of php?

    I think mfillpot has probably misunderstood my question. :huh:
  • marc
    marc Posts: 647
    Well, he is saying that those .cpp files may not be from your applications itself but for something else (modules needed, another program to communicate with another one... dunno!)

    Regards
  • mfillpot
    mfillpot Posts: 2,177
    Marc got the summary of my response and simplified it pretty well.

    The .cpp files that you see listed under the dependent application name are very likely modules meant to communicate between the applications and not the source for the dependent application.
  • ActiveX
    ActiveX Posts: 59
    ok, so what happens if I wanna have the source code for an open source software?

    You mean the file in "http://httpd.apache.org/download.cgi" called Unix source is not the source code of Apache web server, don't you?

    So where is Apache's source? Where can I download it?
  • mfillpot
    mfillpot Posts: 2,177
    You don't seems to really understand what the word dependent means. I will try not to refer to anything else that may confuse you.

    I say that we need to start fresh on your issues with building and installing Apache so we can track your potential errors.

    The source code you downloaded from apache.org is the source code for the project, once it is downloaded you only need to follow the instructions at http://httpd.apache.org/docs/2.2/install.html to compile and install the application with the default options. However if you want to customize the build then you will want to read about the optional configure flags at http://httpd.apache.org/docs/2.2/programs/configure.html#installationdirectories and apply them to your build process.

    I would like appreciate if you would post your build script or if you are doing all of the entry line by line into the terminal then post your ./configure command so we can review what you are trying to configure into the build. I highly recommend using a build script so modifications can be tracked and commented for later use or revisions.
  • ActiveX
    ActiveX Posts: 59
    ok, I seem to have found the problem, now I need your helps again, guys! Thanks

    I need to remove my current installation, but all the truth is what you see below:
    activex@activex-desktop:/media/Archive/sources/linux/httpd-2.2.15$ sudo make uninstall
    [sudo] password for activex: 
    make: *** No rule to make target `uninstall'.  Stop.
    activex@activex-desktop:/media/Archive/sources/linux/httpd-2.2.15$
    

    It's the first problem. And the second one is the one that has amazingly confused me:

    Are the sources I download from sites, say php, or apache, or even the linux kernel itself, from kernel.org, the real souces, I mean the porgrams written in C/C++ or not?
    Are these programs the ones that developers have put time to analyze, put together, etc., just like what Linus Torvalds did 20 years ago, or these C/C++ are the files that have been prepared for me, as a user to swallow?

    If I modify these C/C++ source files, have I really modified the software and customized it, or I've fooled myself?

    That's all I'm terribly curious to know!
  • gomer
    gomer Posts: 158
    Not all make files will have an uninstall target. you should probably double check the INSTALL or README files to see if they mention such a target (it could make remove, etc).

    Yes. Those are the actual applications' source code. Some applications are obviously larger and more complicated than others and will have a larger collection of source files, but that is in essence it. And Yes, if you modify those files, then you hve "customized" the application.

    The packages you install using your distro's package manager, hwoever, are not likely to contain any source code, (with a few exceptions, like applications written in interpreted languages, or specif source packages). But if you find yourself downloading a tar ball and having to run ./configure and/or make, you have the source code to the application.
  • ActiveX
    ActiveX Posts: 59
    after struggling with apache source, I finally had to give up this method, since I'm a Linux beginner, and also I'm short of time, and I used Synaptic to install apache, php and mysql.

    With a search, I found httpd.conf in /etc/apache2/ directory. If you happen to know, this file contains apache global configurations, BUT, the httpd.conf there is totally empty! 0 bytes!

    What should I do? What's missing?
  • mfillpot
    mfillpot Posts: 2,177
    It looks like your distro gives you a blank file awaiting your settings.
    Attached is the httpd.conf from slackware that has some working and sample settings.

    A quick search on google will give you several more examples. [file name=httpd.gz size=5907]http://www.linux.com/media/kunena/attachments/legacy/files/httpd.gz[/file]

Categories

Upcoming Training