The issue is that you’re already running a web server on that system. To find out what it’s doing, you can simply open http://localhost/ from a Remote Desktop session. That web server was not installed by the Sen2Agri installer, and does not come with the system by default. I can’t tell why it’s there, but there must be a (good) reason.
But yes, you can indeed pass this on to the system administrator if you have one.
All right. There’s a warning (it doesn’t know the hostname), but it’s fine to ignore it.
This is somewhat confusing for me. Is this preferring to /etc/nginx/nginx.conf? or do I need to create a new directory?
Yes, you should put that snippet in a file like /etc/nginx/conf.d/sen2agri.host.domain.conf. The error you’re getting is because the upstream and server blocks should be placed inside http. If you move it to a file in will be included there (see the include /etc/nginx/conf.d/*.conf; line. The advantage of this is that it’s easier to make modifications to a site without affecting the others.
And you should replace sen2agri.host.domain with something more appropriate, like the server name (e.g. sen2agri.esscgeo-sen2agri.localdomain). You’ll either need a DNS entry (contact your network administrator for that) or, you’re accessing it from few computers you can add it to the hosts file. In the latter case, edit /etc/hosts (on Linux) and add a line with IP sen2agri.host.domain. Replace IP with the server’s IP address and sen2agri.host.domain with the name you chose before.
sudo systemctl reload nginx (ok, no error)
nginx -t reported an error (because of the misplaced upstream block), so after the reload I suspect that nginx and Only Office are no longer working. To fix that, remove the two blocks you added and run systemctl reload nginx again.
I followed all your advices, just want to share the outcomes.
Here’s the result for the command sudo nginx -t:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Reloading of nginx is also ok. However, I still wasn’t able to access the system’s web interface.
I am sharing this post to my network administrator and update you in this post.
My apologies for bothering you again in this thread. Our system administrator already uninstalled the only office web server. I also reinstall the whole sen2agri system (system ad’s request). However, as I tried to see the status of httpd, these results appeared:
[brentf@ESSCGeo-Sen2Agri conf.d]$ systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2018-02-06 14:21:18 +08; 8min ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 10512 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 10510 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 10510 (code=exited, status=1/FAILURE)
Feb 06 14:21:17 ESSCGeo-Sen2Agri httpd[10510]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Feb 06 14:21:17 ESSCGeo-Sen2Agri httpd[10510]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Feb 06 14:21:17 ESSCGeo-Sen2Agri httpd[10510]: no listening sockets available, shutting down
Feb 06 14:21:17 ESSCGeo-Sen2Agri httpd[10510]: AH00015: Unable to open logs
Feb 06 14:21:18 ESSCGeo-Sen2Agri systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Feb 06 14:21:18 ESSCGeo-Sen2Agri kill[10512]: kill: cannot find process ""
Feb 06 14:21:18 ESSCGeo-Sen2Agri systemd[1]: httpd.service: control process exited, code=exited status=1
Feb 06 14:21:18 ESSCGeo-Sen2Agri systemd[1]: Failed to start The Apache HTTP Server.
Feb 06 14:21:18 ESSCGeo-Sen2Agri systemd[1]: Unit httpd.service entered failed state.
Feb 06 14:21:18 ESSCGeo-Sen2Agri systemd[1]: httpd.service failed.
And here are the results of sudo ss -pantl | grep :80
● postgresql-9.4.service - PostgreSQL 9.4 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-9.4.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2018-02-07 13:00:40 +08; 5 days ago
Docs: https://www.postgresql.org/docs/9.4/static/
Process: 13283 ExecStart=/usr/pgsql-9.4/bin/pg_ctl start -D ${PGDATA} -s -w -t 300 (code=exited, status=1/FAILURE)
Process: 13276 ExecStartPre=/usr/pgsql-9.4/bin/postgresql94-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Feb 07 13:00:39 ESSCGeo-Sen2Agri pg_ctl[13283]: < 2018-02-07 13:00:39.237 +08 >LOG: could not bind IPv4 socket: Address already in use
Feb 07 13:00:39 ESSCGeo-Sen2Agri pg_ctl[13283]: < 2018-02-07 13:00:39.237 +08 >HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
Feb 07 13:00:39 ESSCGeo-Sen2Agri pg_ctl[13283]: < 2018-02-07 13:00:39.273 +08 >FATAL: lock file "/var/run/postgresql/.s.PGSQL.5432.lock" already exists
Feb 07 13:00:39 ESSCGeo-Sen2Agri pg_ctl[13283]: < 2018-02-07 13:00:39.273 +08 >HINT: Is another postmaster (PID 1590) using socket file "/var/run/postgresql/.s.PGSQL.5432"?
Feb 07 13:00:40 ESSCGeo-Sen2Agri pg_ctl[13283]: pg_ctl: could not start server
Feb 07 13:00:40 ESSCGeo-Sen2Agri pg_ctl[13283]: Examine the log output.
Feb 07 13:00:40 ESSCGeo-Sen2Agri systemd[1]: postgresql-9.4.service: control process exited, code=exited status=1
Feb 07 13:00:40 ESSCGeo-Sen2Agri systemd[1]: Failed to start PostgreSQL 9.4 database server.
Feb 07 13:00:40 ESSCGeo-Sen2Agri systemd[1]: Unit postgresql-9.4.service entered failed state.
Feb 07 13:00:40 ESSCGeo-Sen2Agri systemd[1]: postgresql-9.4.service failed.
On the other hand, here are the contents of /var/www/html/ConfigParams.php:
<?php
class ConfigParams {
static $CONN_STRING = 'host=localhost port=5432 dbname=sen2agri user=admin password=sen2agri';
static $SERVICES_URL = 'http://localhost:8080/dashboard';
static $SITE_ID;
static $USER_NAME;
static function init() {
// set login information
if (isset($_SESSION['siteId']) && isset($_SESSION['userId']) && isset($_SESSION['userName'])) {
self::$SITE_ID = $_SESSION['siteId'];
self::$USER_NAME = $_SESSION['userName'];
}
}
}
ConfigParams::init();
?>
I uninstalled all the packages of postgres 9.2 (it was updated automatically by the CentOS system) and successfully started the postgresql-9.4.service, but still can’t log in successfully in the web interface. Any suggestions?
Sorry, been busy these days.
Anyway, yes I can access the sen2agri database from psql but still can’t log in successfully from the web interface.
(using the default credentials).