Find the answer to your Linux question:
Results 1 to 8 of 8
I'M working my way through a python book and it's got me writing a small python script for a web page display on my own system. I'M assuming I'll need ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Dec 2010
    Posts
    122

    installing apache


    I'M working my way through a python book and it's got me writing a small python script for a web page display on my own system. I'M assuming I'll need to download apache to get this to work but I don't know how. After going to apache.org > downloads I'M presented with what looks like a web based file system, something I've never understood. Also, I get to many results from the Ubuntu Software Center to know what I should download. Thanks for any and all replies.

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    After going to apache.org > downloads
    Don't do that. It will be much easier to use the Ubuntu package manager. I don't use the Software Center, usually use synaptic and you should be able to download apache there and get all the dependencies you may need resolved. Just open Synaptic and scroll down to apache or search for it or use the Software Center. Are you going to be using mysql database and/or php/perl? You should be able to find LAMP option somewhere in the software center or Synaptic.

    Might be helpful if you indicated the specific purposes for installing apache.

  3. #3
    Linux Newbie
    Join Date
    Dec 2010
    Posts
    122
    Thanks. But take another look at my thread concerning the reason. I reading a book on python and I've come to a chapter on web programming. I know nothing about servers and I have a thousand questions.

  4. #4
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,601
    Ubuntu should have a package called "apache2" which automatically select everything you need for the basic Apache web server. Then there is "libapache2-mod-python" which you may need to run python.
    "I used to be with it, then they changed what it was.
    Now what was it isn't it, and what is it is weird and scary to me.
    It'll happen to you too."

    Grandpa Simpson



    The Fifth Continent

  5. #5
    Linux Newbie
    Join Date
    Dec 2010
    Posts
    122
    Thanks. Well I got apache installed but now I can't figure out how to start it. Typing apache or apahce2 in the command terminal doesn't work. It's also not listed in any of the gnome applications menu.

    The python book I'M reading also had me to create a small .cgi python script with the first line being #!/usr/bin/env python

    I don't understand that file path. What is env python? There's no / between the two so it looks like that one file to me. My file system does not have a env python file or an env directory under bin. And on my system the python files have 2.6 and 3 behind them.

  6. #6
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,601
    Apache is a server application and as such it runs as a service. This means there will be no entries in the menus. To check if it is running open a terminal and run the following command
    Code:
    ps ax | grep apache
    If you get no processes shown, then you can start the service by running the command
    Code:
    /etc/init.d/apache2 start
    This is a tutorial on setting up vhosts for development. It is for LMDE but should also work for Ubuntu.

    I don't know much about Python but that looks like Python's way of saying where the interperator is.
    "I used to be with it, then they changed what it was.
    Now what was it isn't it, and what is it is weird and scary to me.
    It'll happen to you too."

    Grandpa Simpson



    The Fifth Continent

  7. #7
    Linux Newbie
    Join Date
    Dec 2010
    Posts
    122
    $ ps ax | grep apache
    2735 ? Ss 0:35 /usr/sbin/apache2 -k start
    2846 ? S 0:00 /usr/sbin/apache2 -k start
    14696 ? Z 0:00 [apache2] <defunct>
    14697 ? Z 0:00 [apache2] <defunct>
    14698 ? Z 0:00 [apache2] <defunct>
    14700 pts/0 S+ 0:00 grep --color=auto apache

    Was the output I got.

  8. #8
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    It appears that the Apache daemon is hung. You can try to stop it:

    /etc/init.d/apache2 stop

    but I doubt that'll zap the zombies (defunct processes). you'll probably have to reboot to get rid of them. Before you reboot, make sure the apache daemon is enable to auto-start. i'm not sure about Ubuntu, but maybe something like:

    chkconfig apache2 on

    Regarding the /usr/bin/env question, env is used to search your PATH for python. It is convention used to make scripts more portable by not tying the interpreter down to a specific path.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •