Sunday, December 06, 2020 - Web servers are vital for communicating in our modern world. This blog post walks you through setting up an interactive dynamic web server using CentOS 8 with the Nginx proxy server, Python 3, Web2Py, and PostGreSQL database server.
CentOS is the free-ware version of RedHat Enterprise Server. Therefore, CentOS is an extremely light-weight stable linux operating system and is an excellent choice to build a web platform. The current version of CentOS is 8.
Whether you have a stand-along or cloud machine, i.e., Amazon's AWS, once minimal CentOS is installed, the following procedure will setup your server to a working web server that is dynamically driven by Python 3, Web2Py, and the PostGreSQL backend database server. A very powerful and fully customizable web server and the choice for this website.
> nano /etc/hosts 127.0.0.1 localhost iquanta.info iquanta.org #lucas...commenting out the next line speeds up localhost lookup tremendously #::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 >> Ctrl-X, Save? >> Y, Enter
Setting the timezone of the server is done with:
> date > timedatectl set-timezone America/New_York > date
which also sets the /etc/localtime symbolic link to /etc/usr/share/zoneinfo/America/New_York.
And to set the default client timezone under PostGreSQL update two lines in /var/lib/pgsql/data/postgresql.conf:
> nano /var/lib/pgsql/data/postgresql.conf #------------------------------------------------------------------------------ # CONNECTIONS AND AUTHENTICATION #------------------------------------------------------------------------------ # - Connection Settings - listen_addresses = '*' #------------------------------------------------------------------------------ # CLIENT CONNECTION DEFAULTS #------------------------------------------------------------------------------ # - Locale and Formatting - timezone = 'America/New_York' >> Ctrl-X, Save? >> Y, Enter
> nano /var/lib/pgsql/data/pg_hba.conf #lucas...change local access from ident to trust... # "local" is for Unix domain socket connections only local all all peer # IPv4 local connections: #host all all 127.0.0.1/32 ident host all all 127.0.0.1/32 md5 # IPv6 local connections: #host all all ::1/128 ident host all all ::1/128 md5 # Allow replication connections from localhost, by a user with the # replication privilege. #local replication all peer #host replication all 127.0.0.1/32 ident #host replication all ::1/128 ident #lucas...from lab acess only... host all alternate_login_user 226.166.31.0/24 md5 >> Ctrl-X, Save? >> Y, Enter >systemctl restart postgresql
Please Register / Login here to post or edit comments or questions to our blog.
Back to the Main Blog Page