Some vulnerabilities have been reported in APR-util, which can be exploited by malicious users and malicious people to cause a DoS (Denial of Service) – CVE-2009-1955, CVE-2009-1956, CVE-2009-0023 fix.
The motto of this site is learn with pictures, not words:
In Pictures tutorials began as part of a research study we conducted for the U.S. Department of Education. The goal: to make it easier for people with learning disabilities to learn computer subjects.
As part of the study, we created simple, illustration-based tutorials. Everyone who tested them–not just people with learning disabilities–said the new tutorials enabled them to learn faster and easier than conventional text-heavy books.
The site offers tutorials on common Linux web programming subject:
Great work! (Thanks to E@zyVG for a hat tip)
Learn what slows Apache web server down, and how to get the most out of PHP.
Linux, Apache, MySQL, and PHP (or Perl) form the basis of the LAMP architecture for Web applications. Many open source packages based on LAMP components are available to solve a variety of problems. As the load on an application increases, the bottlenecks in the underlying infrastructure become more apparent in the form of slow response to user requests. The previous article showed you how to tune the Linux system and covered the basics of LAMP and performance measurement. This article focuses on the Web server components, Apache and PHP.
From the article:
Applications using the LAMP (LinuxÂ®, Apache, MySQL, PHP/Perl) architecture are constantly being developed and deployed. But often the server administrator has little control over the application itself because it’s written by someone else. This series of three articles discusses many of the server configuration items that can make or break an application’s performance. This second article focuses on steps you can take to optimize Apache and PHP.
This article focused on tuning the Web server, both Apache and PHP. With Apache, the general idea is to eliminate extra checks the Web server must do, such as processing the .htaccess file. You must also tune the Multi-Processing Module you’re using to balance the system resources used with the availability of idle workers for incoming requests. The best thing you can do for PHP is to install an opcode cache. Keeping your eye on a few resource settings also ensures that scripts don’t hog resources and make the system slow for everyone else.
Tuning LAMP systems, Part 2: Optimizing Apache and PHP
Can someone steal my PHP code or program without hacking my Linux box? Can someone snoop script over plain HTTP session?
Short answer is no. PHP is server side thingy.
However a misconfigured webserver can easily give out php file to all end users. You need to make sure that mod_php / mod_fastcgi loaded and correct MIME type is setup. To avoid such problem always test your server before moving to production environment. Most Linux distro configures both Apache and PHP out of box.
How do I stop downloading php source code?
The first step should be stopping a webserver.
# /etc/init.d/httpd stop
# /etc/init.d/lighttpd stop
If you are using Lighttpd…
Next bind webserver to 127.0.0.1 for testing purpose. Open lighttpd websever config file and bind server address to 127.0.0.1
# vi /etc/lighttpd/lighttpd.conf
Bind to localhost/127.0.0.1:
server.bind = "127.0.0.1"
# /etc/init.d/lighttpd start
Now follow these instructions to configure php as fastcgi module. Now test your configuration using url http://127.0.0.1/test.php. PHP should work on server. If not working, refer to server log file.
If you are using Apache…
Open httpd.conf file and bind apache to 127.0.0.1:
# vi httpd.conf
The Listen directive instructs Apache to listen to more than one IP address or port; by default it responds to requests on all IP interfaces, but only on the port given by the Port directive.
# /etc/init.d/httpd start
Now make sure php is installed use apt-get or rpm command to verify the same:
# rpm -qa | grep -i php
# dpkg --list | grep -i php
If PHP is not installed just follow these instructions to install PHP. Next make sure httpd.conf or php.conf has following directives:
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php
Note: the path may differ in your setup. Now restart httpd:
# /etc/init.d/httpd restart
A sample php code:
<?php phpinfo(); ?>
Finally when php started to work properly, make sure you bind back a server IP address from 127.0.0.1 to public IP address.
Another option is keep your source code out of webroot and server all php requests from php application server using mod_proxy and multiple back-end servers.
Recently I was doing some consultancy work and they need to authenticate users using Active Directory service. However you need to compile Apache web server to add LDAP bindings. Apache LDAP allows an LDAP directory to be used to store the database for HTTP Basic authentication.
Next load LDAP module, configure directory security and you are done.
You don’t have to install and use samba package 🙂
There is a good howto that explains configuration parameters and other stuff.
How to Configure Apache Authentication with Active Directory
OpenSourceParking.com is a domain parking service that helps Free Software and Open Source. Domain parking provides a place-holder web page for an undeveloped domain name.
According to netcraft:
An open source initiative to reverse gains for Microsoft web server software appears to be using edited server headers to try and improve the showing of the Apache web server. Sites using the Open Source Parking service report that they are running on Apache, but appear to actually be hosted on lighttpd. Both Apache and lighttpd are open source web servers, but Apache leads in the Netcraft survey with a 59 percent market share, while lighttpd is a newcomer with just 1.2% share.
This may be implemented for security reasons. There is no need to create a fake open source parking spoofing headers to benefit Apache. Both are open source and robust web servers. Personally this site runs using Lighttpd because of limited resources. Generally I use lighttpd to push static content (images, cached HTML pages and other files) and use Apache for real work :).
You may have noticed that most my webpage are loading bit faster. Here is what I did:
a) CSS code moved to its own file and included CSS at the top
d) Turn on Apache gzip/mod_deflate compression
e) Turn on WordPress caching
f) Turn on php script caching (Iâ€™m using eAccelerator)
g) Tweak MySQL for optimization. Turn on query cache and other settings.
h) If possible switch to lighttpd or use squid / lighttpd as caching server for old good Apache.
If you have tons of cash to burn (assuming that your web app demands performance):
- Consider using CDN (Content Delivery Network) such as Akamai or SAVVIS.
- Server load balancing
However there are some external JS script snippets such as Google Adsense which slows down loading of a webpage. In few months I may roll out a new template and I will try to fix this issue 🙂
I’m interested to know what other people’s experiences with web page optimization. Feel free to share your tips.
This article talks about little known or unknown Apache httpd log mods and tips.
Apache httpd’s standard text logfiles are well understood and useful, but they don’t always give you enough information to troubleshoot problems. Apache 2.x provides several new modules that produce more logfile information–the number of bytes transferred, the rewrite rule matching, which requests complete and why, and the complete output of all headers. Rich Bowen explores these options.
Making Apache httpd Logs More Useful
You can view .chm file using gnochm or kchmviewer under Linux. However sometime you cannot install these programs. There is a third alternative – arCHMage.
From the man page:
arCHMage is an extensible reader and decompiler for files in the CHM format. This is the format used by Microsoft HTML Help, and is also known as Compiled HTML. arCHMage is based on python-chm binding to chmlib from GnoCHM project.
It allows you extract .chm to directory.
Step # 1: Use apt-get command
If you are using Debian / Ubuntu, type the command:
# apt-get install archmage
Step # 2: Extract .chm to directory (directory will be created):
Type the command:
$ archmage file.chm output
Open your browser and type url file:///home/you/output or file:///home/you/output/index.html
You can view chm file using inbuilt http-server.
View chm file using Webserver
You can run archmage as http-server, which will publish chm file contents on specified port:
# archmage -p 8888 /path/to/file.chm &
Open a browser and type ulr http://localhost:8888/ or http://server-ip:8888/
Force apache to publish chm files
You can force Apache to publish chm file contents if there is trailing slash in request to that file. First make sure you have working mod_python. Now open httpd.conf /apache2.conf file:
# vi httpd.conf
Add following lines to your httpd.conf:
AddHandler python-program .chm
Save and close the file. Restart apache.
# /etc/init.d/httpd restart
Now upload file.chm to document root of your Apache webserver. Now view file by typing URL: http://you.com/file.chm/
Note: trailing slash at the end of URL.
=> Download arCHMage
This is an interesting article.
For people migrating from Windows to Linux, the Apache Web server is entirely different world from Microsoft Internet Information Server. Apache can be alienating to IIS / Windows administrators, because migrating to Apache is more than just copying files.
The IIS to Apache migration process needs to be handled with the same care and perspective as the process of migrating desktops and their attendant applications. In some cases, IIS to Apache may be even more difficult and may have a larger impact on users and administrators.
In this article, author talk about the process of migrating a site from IIS to Apache, with Red Hat Linux as the specific target.