Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

New Server Config With Nginx - Httpd Will Not Start Rate Topic   - - - - -

 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 961 posts

Posted 01 February 2017 - 01:03 AM #1

Hi perhaps I might find the solution on this forum as it relates to configuring a vps to unleash the power of a CS Cart.

 

I made an attempt to instal a LEMP stack on my CentOS 6.8 VPS following the instructions here:

 

https://www.digitalo...ack-on-centos-6

 

With a small caveat that I instead of PHP 5.3 opted for PHP 7.

 

All seemed to be okay exempt for the httpd that will not start properly

[root@amjordan ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: (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

What could i have been missing here ?


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • martfox
  • Member
  • Authorized Reseller
  • Join Date: 15-Jan 10
  • 552 posts

Posted 01 February 2017 - 06:32 AM #2

Another daemon is listening on port 80.
Run this command:
 

netstat -anp | grep :80 | grep LISTEN

Above command lists out all processes running and listening on port 80
 
Furthermore make sure you are not declaring Listen 80 twice in .conf files. For example, you might have it both in ports.conf and inn sites-enabled/www.conf.To find out, use:
 

grep -ri listen /etc/apache2

Keep Listen 80 in just a single place.

Next scenario may be that nginx is using the port 80.

Try shutting it down with:
 

service nginx stop


or
 

killall -9 nginx


and then start httpd


CS-Cart with 1 Year FREE Web Hosting | CS-Cart optimized SSD Cloud VPS Servers from €10.00/month
.
VPS SSD Cloud from €10.00 *** Dedicated Servers *** CS-Cart Authorized Reseller and Web Hosting Provider


 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 961 posts

Posted 01 February 2017 - 12:42 PM #3

Another daemon is listening on port 80.
Run this command:
 

netstat -anp | grep :80 | grep LISTEN

Above command lists out all processes running and listening on port 80
 
Furthermore make sure you are not declaring Listen 80 twice in .conf files. For example, you might have it both in ports.conf and inn sites-enabled/www.conf.To find out, use:
 

grep -ri listen /etc/apache2

Keep Listen 80 in just a single place.

Next scenario may be that nginx is using the port 80.

Try shutting it down with:
 

service nginx stop

or
 

killall -9 nginx

and then start httpd

 

 

 

Dear martfox

 

I tried the first

 

 

Another daemon is listening on port 80.
Run this command:
 

netstat -anp | grep :80 | grep LISTENAbove command lists out all processes running and listening on port 80

 

 

and results where
 

[root@amjordan ~]# netstat -anp | grep :80 | grep LISTEN
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      31642/nginx         
tcp        0      0 :::80                       :::*                        LISTEN      31642/nginx         
[root@amjordan ~]# 

then you suggested
 

 

Furthermore make sure you are not declaring Listen 80 twice in .conf files. For example, you might have it both in ports.conf and inn sites-enabled/www.conf.To find out, use:

grep -ri listen /etc/apache2Keep Listen 80 in just a single place.

 

The results were

[root@amjordan ~]# grep -ri listen /etc/apache2
grep: /etc/apache2: No such file or directory
[root@amjordan ~]# 

By know Nginx seems to be culprit

 

 

Next scenario may be that nginx is using the port 80.

Try shutting it down with:

service nginx stop

 

 

as after stopping nginx and restart httpd

 

we get the following by restarting nginx

[root@amjordan ~]# sudo service nginx restart
Stopping nginx:                                            [FAILED]
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
                                                           [FAILED]
[root@amjordan ~]# 

What next ?


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • martfox
  • Member
  • Authorized Reseller
  • Join Date: 15-Jan 10
  • 552 posts

Posted 01 February 2017 - 12:54 PM #4

EDITED:

 

So now, it's the same scenario but with nginx. You will have to edit some server files. Are you familiar with nano editor?


CS-Cart with 1 Year FREE Web Hosting | CS-Cart optimized SSD Cloud VPS Servers from €10.00/month
.
VPS SSD Cloud from €10.00 *** Dedicated Servers *** CS-Cart Authorized Reseller and Web Hosting Provider


 
  • martfox
  • Member
  • Authorized Reseller
  • Join Date: 15-Jan 10
  • 552 posts

Posted 01 February 2017 - 01:09 PM #5

Also it seems, the NGINX configuration is wrong...

 

you cannot have nginx and httpd on the same port


CS-Cart with 1 Year FREE Web Hosting | CS-Cart optimized SSD Cloud VPS Servers from €10.00/month
.
VPS SSD Cloud from €10.00 *** Dedicated Servers *** CS-Cart Authorized Reseller and Web Hosting Provider


 
  • martfox
  • Member
  • Authorized Reseller
  • Join Date: 15-Jan 10
  • 552 posts

Posted 01 February 2017 - 01:16 PM #6

Check this https://www.digitalo...roxy-for-apache


CS-Cart with 1 Year FREE Web Hosting | CS-Cart optimized SSD Cloud VPS Servers from €10.00/month
.
VPS SSD Cloud from €10.00 *** Dedicated Servers *** CS-Cart Authorized Reseller and Web Hosting Provider


 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 961 posts

Posted 01 February 2017 - 02:31 PM #7

EDITED:

 

So now, it's the same scenario but with nginx. You will have to edit some server files. Are you familiar with nano editor?

 

Yes I am, find it much friendlier than vi


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • martfox
  • Member
  • Authorized Reseller
  • Join Date: 15-Jan 10
  • 552 posts

Posted 01 February 2017 - 02:52 PM #8

Any success with the configuration from https://www.digitalo...roxy-for-apache ?


CS-Cart with 1 Year FREE Web Hosting | CS-Cart optimized SSD Cloud VPS Servers from €10.00/month
.
VPS SSD Cloud from €10.00 *** Dedicated Servers *** CS-Cart Authorized Reseller and Web Hosting Provider


 
  • mazter
  • Senior Member
  • Members
  • Join Date: 04-Apr 12
  • 258 posts

Posted 01 February 2017 - 02:52 PM #9

Have you guys checked serverpilot.io ? I found it much more simplistic and gets the job done.



 
  • martfox
  • Member
  • Authorized Reseller
  • Join Date: 15-Jan 10
  • 552 posts

Posted 01 February 2017 - 03:14 PM #10

Have you guys checked serverpilot.io ?

It's very limited. All it does is allows you to set up a directory, database, and domain for a app.


CS-Cart with 1 Year FREE Web Hosting | CS-Cart optimized SSD Cloud VPS Servers from €10.00/month
.
VPS SSD Cloud from €10.00 *** Dedicated Servers *** CS-Cart Authorized Reseller and Web Hosting Provider


 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 961 posts

Posted 01 February 2017 - 04:48 PM #11

Any success with the configuration from https://www.digitalo...roxy-for-apache ?

 

Not yet

 

I am looking at the instructions martfox.

I am a bit confused, I cannot remember installing Apache actually on this VPS. The instructions I followed did not speak of Apache but of Nginx.

I only deviated from the original instructions  given here

 

https://www.digitalo...ack-on-centos-6

 

as where I replaced the instruction for php 5.3 for these http://tecadmin.net/...hp-7-on-centos/

 

I guess I mixed things up a bit.

Now I have to start to undo what I did wrong


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 961 posts

Posted 01 February 2017 - 04:50 PM #12

Have you guys checked serverpilot.io ? I found it much more simplistic and gets the job done.

 

No I have not and I am not looking for a cpanel replacement


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 961 posts

Posted 01 February 2017 - 05:05 PM #13

configure-nginx.jpg

 

@martfox

 

I presume that this suggests that I have already setup virtual hosts but I have not.

sudo nano /etc/nginx/ .... is empty 

Step 3 was about installing nginx and in step 4 in this digitalocean.com tutorial they talked about installing PHP. As it turned out it was PHP 5.3 and not PHP 7 as I intended. I unstalled PHP 5.3 and use the tutorial of techadmin.com

 

http://tecadmin.net/...hp-7-on-centos/

 

To install PHP 7.0 and from there on I returned to Step 5 of the digitalocean tutorial i was following where it says that step 5 is all about configuring php.

 

I presume there is where it went wrong for me.


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • mazter
  • Senior Member
  • Members
  • Join Date: 04-Apr 12
  • 258 posts

Posted 01 February 2017 - 05:08 PM #14

No I have not and I am not looking for a cpanel replacement

 

I understand. It is not just cpanel replacement but it sets up:

 

nginx as proxy with SSL support => apache => php fpm with opcache => mysql

 

It is very difficult to get this setup up and running individually.

 

Good luck with your setup.



 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 961 posts

Posted 01 February 2017 - 05:24 PM #15

I understand. It is not just cpanel replacement but it sets up:

 

nginx as proxy with SSL support => apache => php fpm with opcache => mysql

 

It is very difficult to get this setup up and running individually.

 

Good luck with your setup.

 

 

Thanks mazter.  I will surely keep your suggestion as a backup plan should this truly fail.


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • abolshakov
  • Architect
  • CS-Cart Architects
  • Join Date: 20-Aug 14
  • 93 posts

Posted 01 February 2017 - 05:40 PM #16

Hi. Consider looking at our official documentation, which tells how to configure a VPS for the maximum CS-Cart performance following three simple steps: http://docs.cs-cart...._playbooks.html


Alexander Bolshakov
CS-Cart Architect Team


 
  • martfox
  • Member
  • Authorized Reseller
  • Join Date: 15-Jan 10
  • 552 posts

Posted 01 February 2017 - 07:42 PM #17

@Mongoose

 

Ok, but are apache and nginx now running?


CS-Cart with 1 Year FREE Web Hosting | CS-Cart optimized SSD Cloud VPS Servers from €10.00/month
.
VPS SSD Cloud from €10.00 *** Dedicated Servers *** CS-Cart Authorized Reseller and Web Hosting Provider


 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 961 posts

Posted 01 February 2017 - 08:57 PM #18

@Mongoose

 

Ok, but are apache and nginx now running?

 

I had a friend walk me through the steps I followed before but as it turned out my firewall blocked port 80 that is one thing and the other is that I am still in the process of making nginx work for me.


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 961 posts

Posted 01 February 2017 - 09:22 PM #19

Hi. Consider looking at our official documentation, which tells how to configure a VPS for the maximum CS-Cart performance following three simple steps: http://docs.cs-cart...._playbooks.html

 

@abolshakov

 

What is this Playbook actually ? Is it a script that can be executed at this moment when I am still having to get Nginx to accept and execute php files ?


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • gleb.goncharov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 04-Oct 13
  • 351 posts

Posted 02 February 2017 - 04:19 AM #20

@abolshakov

 

What is this Playbook actually ? Is it a script that can be executed at this moment when I am still having to get Nginx to accept and execute php files ?

 

Playbook is an Ansible's configuration language. Ansible is a software configuration management tool. It describes a set of steps you want to execute. So, @cscart/server-ansible-playbooks helps to configure environment for CS-Cart and Multi-Vendor. You should use lemp7.yml to set up NGINX + PHP-FPM 7.0.x. (FastCGI). This is the easiest way to bootstrap your server from scratch without any knowledge of server configuration.