web error 503 after install docker and nginx
before this my website using apache to server the website. but when i install docker and nginx, log in page does'nt direct to php file to authenticate the user.
[email protected]:~$ docker run --name docker-nginx -p 80:80 -d nginx
and get this error :
docker: Error response from daemon: driver failed programming external connectivity on endpoint docker-nginx (ae7e635569ed7c36806c4bc53cc145ae423bed0b0ecb289c37b8e0c75ac0a70c): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use.
after that i try remove nginx and rerun the same command it gave this following error:
docker: Error response from daemon: Conflict. The container name "/docker-nginx" is already in use by container "a6ac80b
0872457c2fcec62b398ed4de972a21bf9135b4b25df2795f56a60e7cf". You have to remove (or rename) that container to be able to
reuse that name.
i tried to restart apache using 'apache2ctl restart'
and get this error:
AH00526: Syntax error on line 34 of /etc/apache2/sites-enabled/000-default-le-ssl.conf:
SSLCertificateFile: file '/etc/letsencrypt/live/sizzia.com/fullchain.pem' does not exist or is empty
Action 'restart' failed.
what i trying to do is reverse back to origin state where using apache to serve the website
It looks like there are a couple things going on here. The first is that a docker container with that name already exists. The second issue is that there is something wrong with the ssl configuration for apache.
To fix the first issue you can remove the nginx docker and recreate it with the same name. Another option is to just create a new container with a different name (maybe docker-apache2).
If you want to remove the container and just reuse the name you can run the following:
docker rm docker-nginx
After you remove the container you just need to recreate it.
For the second issue I would take a look at line 34 in the following file:
It looks like there is a syntax error. Correcting that syntax error might resolve you apache issue.
Let us know if that works for you!
Done for removing docker-nginx. But thenI tried to open /etc/apache2/sites-enabled/000-default-le-ssl.conf but it return said no such file or directory, failed to retrieve directoey listing. Is it the file is corrupt?
I also tried to check apache status by all the 3 method shows and result shown exactly as in the picture.
Btw, i used different command to restart: /etc/init.d/apache2/restart then console return 'ok'
But yet the log in page is not respon:
Http/1.1 503 service unavailable
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
ProxyPass /bridge http://localhost:3001
ProxyPassReverse /bridge http://localhost:3001
I think the localhost do not work properly why is the header responds page should go to https//sizzia.com/login.html to https://sizzia.com/bridge/login (login.php through xmlhttprequest)
If this was the problem how do i correct this?