Linux - ServerThis 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.
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.
Hi all,
I've just tried to install Apache2 on my computer, but it doesn't seem to work.
After installing it, I pointed my browser to http://localhost, but I get the "Unable to connect" message.
I have also tried running
Code:
/etc/init.d/apache2 start
to see if it was running, but I get no output, so I'm really wondering if there is something I need to configure...
Please notice that this is the first time I try to run Apache on my machine, so I'm quite new to this.
Hi,
thanks for your reply.
I have used both /etc/init.d/apache2 start and restart, and I have run them as root, but I didn't get any output. However, if I do:
Code:
# /etc/init.d/apache2 stop
Stopping web server (apache2)....
It seems it was running.
So, I tried to do /etc/init.d/apache2 start again, but again I could see no output and the address http://localost won't work.
You have asked (/etc/default/apache2, NO_START=1) apache2 to not be started at boot (/etc/init.d).
Invoking it manually is like doing the boot process (init.d doesn't know if you are booting or not)
Then you have to start your apache2 by
What I find odd is that when I shut down the system there is a message that says it's stopping Apache.
Anyway, your command is giving me output, but still not working:
Code:
# apache2ctl start
apache2: Syntax error on line 189 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/httpd.conf: No such file or directory
So I guess I need that config file... where to get it?
I have installed it through apt. How on earth am I missing bits and pieces?
I have uninstalled it and re-installed it:
Code:
# apt-get install apache2
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
apache2-mpm-worker
The following NEW packages will be installed
apache2 apache2-mpm-worker
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/459kB of archives.
After unpacking 766kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Selecting previously deselected package apache2-mpm-worker.
(Reading database ... 76551 files and directories currently installed.)
Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.2.3-4_i386.deb) ...
Selecting previously deselected package apache2.
Unpacking apache2 (from .../apache2_2.2.3-4_all.deb) ...
Setting up apache2-mpm-worker (2.2.3-4) ...
Setting up apache2 (2.2.3-4) ...
theraft:/home/mmanu# apache2ctl start
apache2: Syntax error on line 189 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/httpd.conf: No such file or directory
what I find odd is that while apache is not starting at boot, there is a message that it's stopping when I shut down the computer...
This will create an empty file. Mine is empty and its an unmodified version.
I wonder what happened when you installed it???
Actually what I advice is to reinstall apache2 and its dependencies but you need to PURGE the package. Otherwise in 5mn you will tell me that another file is missing
Code:
dpkg -l | grep apache2
if you are not scared of removing them all, use this:
AH! Thanks, it's working now
I get a message like this:
Code:
# apache2ctl start
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
but I guess it's fine.
Thanks a bunch for your help!
EDIT: Ah! I forgot to mention that I still had to creat the httpd.conf empty file.
And now I have installed php ( php5 and libapache2-mod-php5) in order to see my website offline, but the pages are not working (when I try to see them with Iceweasel, it offers me to donwload them). And notice that Apache is running and working...
EDIT2: Nevermind, now everything is up and running. Thanks again for your help!
EDIT: Ah! I forgot to mention that I still had to creat the httpd.conf empty file.
And now I have installed php ( php5 and libapache2-mod-php5) in order to see my website offline, but the pages are not working (when I try to see them with Iceweasel, it offers me to donwload them). And notice that Apache is running and working...
and there:
Quote:
Originally Posted by finferflu
EDIT2: Nevermind, now everything is up and running. Thanks again for your help!
Could you please tell me how you solved the problem?
btw: I just upgraded from Ubuntu 6.10 to 7.04 and that made it stop working.
The only httpd.conf I could find is located here: /etc/apache2/httpd.conf
And it contains only the following:
Code:
# This is here for backwards compatability reasons and to support
# installing 3rd party modules directly via apxs2, rather than
# through the /etc/apache2/mods-{available,enabled} mechanism.
#
#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so
yes, I think you missed the same thing I had missed: in order to see a webpage you have to put it in the folder /var/www/ (notice that you can also put the whole website folder in there). After that your pages will be visible
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.