You use Apache, or other compatible http server, to access the infx services from a browser. By setting up ssh keys (setup ssh keys) from the server with Apache, to your other servers running infx, you can manage all your Informix instances from the one installation of Apache. Select a port number that is not in use if for this service, e.g. 63000, then access infx via: http://server:63000/Any user who tries to access the above address will be prompted for a user name and password. In this guide I show you how to use basic authentication for this.
set up virtual hostWe set up a virtual host within Apache so it knows where to direct our requests to. Edit the Apache config file, probably in /etc/httpd/conf/httpd.conf. Add this virtual host section, change server to your server name, and the port to your preferred port. You need to be the root user to edit httpd.conf, add the lines at the end. Listen server:63000NameVirtualHost server:63000<VirtualHost server:63000> DocumentRoot /infx/www/docroot ServerName server ErrorLog /infx/www/logs/infx-error.log CustomLog /infx/www/logs/infx.log common SetOutputFilter DEFLATE ScriptAlias /infx/scgi-bin/ "/infx/www/scgi-bin/" Alias /infx/ "/infx/www/docroot/" <Directory /infx/www/scgi-bin> AuthType Basic AuthName infxadmin AuthUserFile /infx/www/htpasswd Require user infxadmin </Directory> <IfModule mod_setenvif.c> <IfModule mod_headers.c> BrowserMatch chromeframe gcf Header append X-UA-Compatible "chrome=1" env=gcf </IfModule> </IfModule></VirtualHost>If Apache is only going to be used for infx, add these lines: User informixGroup informixOn potential issue with this is, if Apache is also being used for something else, e.g. an operating system monitoring tool. Only infx should be running as informix. There is also a risk involved with running daemon processes that listen on network ports, such as Apache, as an administrative user like informix. If someone can exploit Apache to gain access to your server, that access will be as the informix user. If you run the process as a limited, non-administrative account, that access can be restricted. root@server# mkdir /var/www/infxroot@server# chown informix:informix /var/www/infxroot@server# mv /infx/www/scgi-bin /var/www/infxroot@server# chmod 755 /var/www/infx/scgi-binroot@server# chmod 755 /var/www/infx/scgi-bin/* root@server# ln -s /var/www/infx/scgi-bin /infx/www/scgi-binroot@server# ls -l /infx/www/scgi-binlrwxrwxrwx 1 root root 22 Mar 10 08:10 /infx/www/scgi-bin -> /var/www/infx/scgi-binroot@server1# ls -l /var/www/infx/scgi-bintotal 12-rwxr-xr-x 1 informix informix 2656 Mar 5 06:51 infx.cgi-rwxr-xr-x 1 informix informix 4720 Mar 5 05:09 infxservice.cgiMake these changes to what we added above, to reference the new location under /var/www. Add add the SuexecUserGroup directive. Listen server:63000NameVirtualHost server:63000<VirtualHost server:63000> DocumentRoot /infx/www/docroot ServerName server ErrorLog /infx/www/logs/infx-error.log CustomLog /infx/www/logs/infx.log common SetOutputFilter DEFLATE SuexecUserGroup informix informix ScriptAlias /infx/scgi-bin/ "/var/www/infx/scgi-bin/" Alias /infx/ "/infx/www/docroot/" <Directory /var/www/infx/scgi-bin> AuthType Basic AuthName infxadmin AuthUserFile /infx/www/htpasswd Require user infxadmin </Directory></VirtualHost>Remove the User informix/Group informix lines. Now Apache will run as a default user, and only the CGI scripts will execute as the informix user. setup authenticationSet the password for the infxadmin login, as the informix user noenv@server:/home/informix/.ssh>htpasswd -c /infx/www/htpasswd infxadminNew password:Re-type new password:Adding password for user infxadminYou can use this command to change the infxadmin password at any time, and you should do so regularly. This provides basic authentication only. You should decide on what the best method is for you. Minimally you need to require entry of a password to access infx from the browser. You should treat this password the same as the informix password, as it gives the same level of access. You must use the username of infxadmin, as the CGI scripts require all requests to be logged through that user. restartRestart Apache, as root, so the settings take effect . root@server# /etc/init.d/httpd restartStopping httpd: [ OK ]Starting httpd: [ OK ]root@server1#You can now manage the server with this address: http://server:63000/ |
