Please note the new address for this forum : forum.excito.org. The old address redirects here but I don't know for how long. Thanks !
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

cant start apache

Got problems with your B2 or B3? Share and get helped!
Post Reply
SailFishing
Posts: 21
Joined: 19 Oct 2009, 18:39

cant start apache

Post by SailFishing »

I have been playing with apache attempting to get SSL working. I had just tried to get /etc/apache2/sites-enabled/bubba to look for my self signed certs and restarting of apache failed and has left me with no web service!

I believe I have now reverted to the original config files however still get the following error when trying to start apache

Code: Select all

bubba:/etc/apache2# /etc/init.d/apache2 stop
Stopping web server (apache2)...[Fri Jun 11 21:24:56 2010] [warn] NameVirtualHost *:443 has no VirtualHosts
[Fri Jun 11 21:24:56 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
httpd (no pid file) not running
.
bubba:/etc/apache2# /etc/init.d/apache2 start
Starting web server (apache2)...[Fri Jun 11 21:25:04 2010] [warn] NameVirtualHost *:443 has no VirtualHosts
[Fri Jun 11 21:25:04 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
(98)Address already in use: make_sock: could not bind to address [::]:443
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
Unable to open logs
 failed!
bubba:/etc/apache2# 
My /etc/apache2/sites-enabled/bubba is as below

Code: Select all

Listen 443

NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:443>
	SSLEngine on
	SSLCertificateFile      /etc/apache2/cacert.pem     
	SSLCertificateKeyFile   /etc/apache2/privkey.pem     	



	ServerAdmin webmaster@localhost

	DocumentRoot /home/web
	DirectoryIndex index.html index.htm index.cgi index.pl index.php index.xhtml
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /home/web/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride AuthConfig
		Order allow,deny
		allow from all
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /var/log/apache2/error.log
	LogLevel warn
	CustomLog /var/log/apache2/access.log combined
	ServerSignature On

	Alias /icons/ "/usr/share/apache2/icons/"
	<Directory "/usr/share/apache2/icons">
		Options Indexes MultiViews
		AllowOverride None
		Order allow,deny
		Allow from all
	</Directory>

</VirtualHost>

<VirtualHost *:80>
	ServerAdmin webmaster@localhost

	DocumentRoot /home/web
	DirectoryIndex index.html index.htm index.cgi index.pl index.php index.xhtml
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /home/web/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride AuthConfig
		Order allow,deny
		allow from all
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /var/log/apache2/error.log
	LogLevel warn

	CustomLog /var/log/apache2/access.log combined
	ServerSignature On

	Alias /icons/ "/usr/share/apache2/icons/"
	<Directory "/usr/share/apache2/icons">
		Options Indexes MultiViews
		AllowOverride None
		Order allow,deny
		Allow from all
	</Directory>

</VirtualHost>
Looking back where I've been the only other file opened was ports.conf which just contains

Listen 80




Would be very greatful if someone could spot whats wrong, or point me in the right direction to restore default apache / send me config files...?

again many thanks!!
SailFishing
Posts: 21
Joined: 19 Oct 2009, 18:39

Re: cant start apache

Post by SailFishing »

I have got httpd running again with the following warns by removing the line

Listen 443

from the top of ./sites-available/bubba

are the warnings anything to be concerned about?


also does anybody know a good howto on setting up ssl?

going to make a back of /etc/apache2 in case I mess it up agian....
carl
Posts: 474
Joined: 07 May 2008, 04:41

Re: cant start apache

Post by carl »

It might be you have an rouge apache process still running.

Could you run following code and return the output? (I know the code is ugly, but I don't need the whole ps auxfww output):

Code: Select all

ps ufww --sid=$(ps -C apache2 -o sess --no-headers | sort | uniq | grep -v -E '^ +0$' | awk 'NR==1{x=$0;next}NF{x=x","$0};END{gsub(/[[:space:]]*/,"",x);print x}')
/Carl Fürstenberg, Excito Software Developer
http://www.excito.com
support@excito.com
SailFishing
Posts: 21
Joined: 19 Oct 2009, 18:39

Re: cant start apache

Post by SailFishing »

The command didn't execute as expected :

Code: Select all

bubba:/home/kev# ps ufww --sid=$(ps -C apache2 -o sess --no-headers | sort | uniq | grep -v -E '^ +0$' | awk 'NR==1{x=$0;next}NF{x=x","$0};END{gsub(/[[:space:]]*/,"",x);print x}')
ERROR: Some sid thing(s) must follow --sid.
********* simple selection *********  ********* selection by list *********
-A all processes                      -C by command name
-N negate selection                   -G by real group ID (supports names)
-a all w/ tty except session leaders  -U by real user ID (supports names)
-d all except session leaders         -g by session OR by effective group name
-e all processes                      -p by process ID
T  all processes on this terminal     -s processes in the sessions given
a  all w/ tty, including other users  -t by tty
g  OBSOLETE -- DO NOT USE             -u by effective user ID (supports names)
r  only running processes             U  processes for specified users
x  processes w/o controlling ttys     t  by tty
*********** output format **********  *********** long options ***********
-o,o user-defined  -f full            --Group --User --pid --cols --ppid
-j,j job control   s  signal          --group --user --sid --rows --info
-O,O preloaded -o  v  virtual memory  --cumulative --format --deselect
-l,l long          u  user-oriented   --sort --tty --forest --version
-F   extra full    X  registers       --heading --no-heading --context
                    ********* misc options *********
-V,V  show version      L  list format codes  f  ASCII art forest
-m,m,-L,-T,H  threads   S  children in sum    -y change -l format
-M,Z  security data     c  true command name  -c scheduling class
-w,w  wide output       n  numeric WCHAN,UID  -H process hierarchy
bubba:/home/kev#



Thanks in advance for the help...
carl
Posts: 474
Joined: 07 May 2008, 04:41

Re: cant start apache

Post by carl »

SailFishing wrote:The command didn't execute as expected :

Code: Select all

bubba:/home/kev# ps ufww --sid=$(ps -C apache2 -o sess --no-headers | sort | uniq | grep -v -E '^ +0$' | awk 'NR==1{x=$0;next}NF{x=x","$0};END{gsub(/[[:space:]]*/,"",x);print x}')
ERROR: Some sid thing(s) must follow --sid.
********* simple selection *********  ********* selection by list *********
-A all processes                      -C by command name
-N negate selection                   -G by real group ID (supports names)
-a all w/ tty except session leaders  -U by real user ID (supports names)
-d all except session leaders         -g by session OR by effective group name
-e all processes                      -p by process ID
T  all processes on this terminal     -s processes in the sessions given
a  all w/ tty, including other users  -t by tty
g  OBSOLETE -- DO NOT USE             -u by effective user ID (supports names)
r  only running processes             U  processes for specified users
x  processes w/o controlling ttys     t  by tty
*********** output format **********  *********** long options ***********
-o,o user-defined  -f full            --Group --User --pid --cols --ppid
-j,j job control   s  signal          --group --user --sid --rows --info
-O,O preloaded -o  v  virtual memory  --cumulative --format --deselect
-l,l long          u  user-oriented   --sort --tty --forest --version
-F   extra full    X  registers       --heading --no-heading --context
                    ********* misc options *********
-V,V  show version      L  list format codes  f  ASCII art forest
-m,m,-L,-T,H  threads   S  children in sum    -y change -l format
-M,Z  security data     c  true command name  -c scheduling class
-w,w  wide output       n  numeric WCHAN,UID  -H process hierarchy
bubba:/home/kev#



Thanks in advance for the help...
That means apache2 isn't running. Have you by any change installed lighttpd?
/Carl Fürstenberg, Excito Software Developer
http://www.excito.com
support@excito.com
SailFishing
Posts: 21
Joined: 19 Oct 2009, 18:39

Re: cant start apache

Post by SailFishing »

No definately not, apache2 is running, I just tried a page i know is not there in my browser and got the apache 404 error ie.

Code: Select all

Not Found

The requested URL /jjjh was not found on this server.
Apache/2.2.3 (Debian) mod_fastcgi/2.4.2 PHP/5.2.6-5ex1 with Suhosin-Patch mod_ssl/2.2.3 OpenSSL/0.9.8c Server at 192.168.0.2 Port 80
this was generated by apache running on bubba...
carl
Posts: 474
Joined: 07 May 2008, 04:41

Re: cant start apache

Post by carl »

Could you check in /etc/apache2/sites-enabled that you don't have any duplicates? i.e. backup files or similar; as apache will read all files in that particular directory, and a duplicate can really throw it off.
/Carl Fürstenberg, Excito Software Developer
http://www.excito.com
support@excito.com
SailFishing
Posts: 21
Joined: 19 Oct 2009, 18:39

Re: cant start apache

Post by SailFishing »

Absolutely spot on carl!

I had made a back up of the bubba confing file in sites-enabled and apache2 was attemping to start duplicate virtual servers...

Again, many thanks, I've now moved the file and apache is now starting without any errors...


cheers,

Kev
Post Reply