setting up LAMP
root@li245-126:~# /etc/init.d/apache2 restart
Restarting web server: apache2(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
failed!
I have contacted the support and they told me
"Apache is unable to listen for network connections on port 80 as nginx is already doing so."
so now I'm not even sure if apache got installed or not…
please any help is appreciated!
11 Replies
Run the following command as root, what's the output?
netstat -tulpen | grep :80
@Nuvini:
What's the IP?
Run the following command as root, what's the output?
netstat -tulpen | grep :80
the server ip is 173.255.235.126
and the output is;
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 0 2927 1723/nginx
tcp6 0 0 :::80 :::* LISTEN 0 2928 1723/nginx
thanks for the help
If you just want Apache you can remove nginx with apt-get remove nginx
or just do /etc/init.d/nginx stop
After that /etc/init.d/apache2 start should work.
so what I got to do is then stop nginx and start apache with those comands….
thank you very much for the help!
You can't have 2 services listening on the same port
So yep indeed, with /etc/init.d/nginx stop apache will be able to start.
Make sure you disable nginx to run at boot though, otherwise these 2 will conflict when you reboot the system.
To disable nginx at boot run:
update-rc.d -f nginx disable
Do you work with servers? I might need some more help to get everything set up, I would like to learn the procedures so going to give it a try on my own, but just in case how much would you charge me to set it up?
Good luck!
thanks
> Log into your Dynadot account.
Click on the "Domains" tab in the main menu.
Click on the link listed in the "Name Server" column. After the page loads, you should see your current name server choice close to the top of the page.
Click on the "DNS" tab.
Select the Record Type, then enter in the IP Address or Target Host of your web server in the first text box.
If you have an Email Server or MX Record available for your domain email, enter in the hostname and the distance (otherwise known as priority) in the subsequent text boxes. You can also specify subdomain A records, CNAME records, email aliases (in the "Email Forwarding Settings" box), and a TXT record.
Click the "Use Dynadot DNS" button to save your changes.
Or if you want to use Linode log in to your control panel –> DNS Manager --> Add a zone and config it from there. Then at Dynazone change the nameservers to the following:
Make sure you pick one of the two options, not both. Only one is needed (and can be used).
Reloading web server config: apache2[Thu Jun 07 18:39:43 2012] [warn] default VirtualHost overlap on port 80, the first has precedence
[Thu Jun 07 18:39:43 2012] [warn] NameVirtualHost 173.255.235.126:443 has no VirtualHosts
and when I go to the domain I created the virtual host for hotmusicvideos.tv it conected to a diferent site 4yahoo.com I can see it by the email
ServerName hotmusicvideos.tv
ServerAlias
DocumentRoot /var/www/hotmusicvideos/
ErrorLog /var/www/hotmusicvideos/logs/error.log
CustomLog /var/www/hotmusicvideos/logs/access.log combined
ls /etc/apache2/sites-enabled/
AFAIK Apache sorts out the priority of vhosts by the alphabet/numeric. So normally you would need 2+ vhosts with multiple domains:
a 0-default (or something with a 0 to make sure it comes first). Now when someone visits your site by IP and there's no corresponding domain the person will get that page (so it's like a fallback/default page if nothing else matches)
I use this for mine:
# vHost configuration
<virtualhost *:80="">ServerAdmin admin@nuvini.com
ServerName nuvini.com
ServerAlias www.nuvini.com
# Logs
DocumentRoot /srv/www/nuvini.com/public_html/
ErrorLog /srv/www/nuvini.com/logs/error.log
CustomLog /srv/www/nuvini.com/logs/access.log combined</virtualhost>
# Enable Rewrite
RewriteEngine On
I believe you can make a subdomain like "placeholder.hotmusicvideos.tv "and give people that page when something is invalid
(Though actually, purely for a fallback rewrite should not be needed)
After that your actual vhosts for normal content: (Editing out the domains since it's a private domain I use)
# vHost configuration
<virtualhost *:80="">ServerAdmin admin@nuvini.com
ServerName <snip>ServerAlias www. <snip># Logs
DocumentRoot /srv/www/<snip>/public_html/
ErrorLog /srv/www/<snip>/logs/error.log
CustomLog /srv/www/<snip>/logs/access.log combined</snip></snip></snip></snip></snip></virtualhost>
# Enable Rewrite
RewriteEngine On
Regarding your errors:
The first one: I guess it is something wrong with the default vhost that is enabled (the one where I used 0-default. Try the thing I posted above?
Second one: I think it means you're also listening on HTTPS (443) but there's no vhost configured for that port. If you're just using HTTP, so no HTTPS, disable listening on port 443 in the apache configuration. (Otherwise, adjust the virtualhost to also listen on port 443, and not just 80)
Also I'm not sure where you got the 4yahoo from, is it a site you own/host? Or did you insert this anywhere in your configuration?
Lastly, the edits you make with the vhosts: use /etc/apache2/sites-available to make the edits. The ones in sites-enabled are links to the sites-available files. Use a2ensite and a2dissite to disable/enable the virtual hosts. (e.g. a2dismod default if you have a filed called default in /etc/apache2/sites-available/)
Good luck, hope it's a bit clear :p