![]() nginx doesn’t have this functionality I must rotate my logs with an external script. In Apache, I achieve this with rotatelogs(8), a program shipped with Apache. I rotate my web logs daily, and retain them indefinitely, in a file named by date. The first thing I need to change is the nginx error log. Various web-server-wide settings log formats, include files, etc. General nginx settings: pid file, user, etc. usr/local/etc/nginx/nf is a sparse, C-style hierarchical configuration file. ScriptAlias /awstats/ "/usr/local/www/awstats/cgi-bin/" ServerAlias ErrorDocument 404 /index.htmlĮrrorLog "|/usr/local/sbin/rotatelogs /var/log/bh/bh_error_log.%Y-%m-%d-%H_%M_%S 86400 -300"ĬustomLog "|/usr/local/sbin/rotatelogs /var/log/bh/bh_spam_log.%Y-%m-%d-%H_%M_%S 86400 -300" combined env=spamĬustomLog "|/usr/local/sbin/rotatelogs /var/log/bh/bh_access_log.%Y-%m-%d-%H_%M_%S 86400 -300" combined env=!spamĪlias /awstatclasses "/usr/local/www/awstats/classes/"Īlias /awstatscss "/usr/local/www/awstats/css/"Īlias /awstatsicons "/usr/local/www/awstats/icons/" Here’s the Apache 2.2 configuration for it. (I’ll cover the WordPress parts in later posts.) I expect to get all of the functionality out of nginx that I have on Apache.įor many years, was my main Web site. To start, I’m moving my static Web sites to the new server. I’ll have to find another way to deal with referrer spam, but at least the site will be up more consistently. Also, nginx doesn’t support anything like the mod_security application firewall. #Awstats io passwordhtaccess for password protection I must put my password protection rules directly in the nginx configuration. Look for the Apache modules you use, and see if they have an nginx equivalent. According to the documentations I’ve dug up, it should all Just Work.īefore making this kind of switch, check the nginx module comparison page. The new server runs FreeBSD 9/i386 running on VMWare ESXi. WordPress seems to be the best of the available evils - er, Web site design tools. I’d like to switch to Postgres as well, but WordPress’s official release doesn’t yet support Postgres. Apache, with all its modules, has a lot of moving parts.Īfter six months of intermittent debugging, I decided that with the new hardware I would switch Web server software, and settled on nginx. The more moving parts something has, the harder it is to debug. I must log in, kill Apache, and restart it. Every so often, Apache devours all available memory and the server becomes very very slow. This is merely an example of what you can put into a VirtualHost.My more complex Web sites run atop WordPress on Apache and MySQL. Your VirtualHosts don't have to be this complicated at all. This VirtualHost contains lots of options, and directives. # AuthLDAPURL ldap://localhost/dc=yourdomain,dc=com?cn?sub # AuthLDAPBindPassword apacheldap_password # AuthLDAPBindDN cn=apacheldap,dc=yourdomain,dc=com # AuthName "AWStats Admin Access Required" # This is currently commented out (so will not work) # This is to force authentication when trying to access /awstats # This is to allow access to the cgi-bin folder # This is to permit URL access to scripts/files in AWStats directory. ScriptAlias /awstats/ "/usr/local/awstats/cgi-bin/" # Directives to allow use of AWStats as a CGIĪlias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"Īlias /awstatscss "/usr/local/awstats/wwwroot/css/"Īlias /awstatsicons "/usr/local/awstats/wwwroot/icon/" CustomLog /var/log/_accesslog combinedĮrrorLog /var/log/_errorlog ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |