PHP versus ASP.NET – Windows versus Linux

How does IMPLEMENTATION Performance Compare ?

Usually, when someone creates benchmarks, they are trying to prove that their thing is faster than someone else's thing.

I’m PAID by Microsoft to write BOTH PHP and ASP.NET Code. I was doing PHP before .NET shipped. I love them both.

This makes it hard for me to say anything good about either one. When I confer a preference for something in PHP, my Microsoft peers send me flame mail and when I confer a preference for something in ASP.NET, my PHP friends come out of the woodwork to call me a Microsoft shill.

I started building and running these tests because everyone had opinions about comparative PHP performance (Windows versus Linux & 5.2 versus 5.3), but no one had any solid data.

So, I decided to collect some empirical evidence of my own.

Before you look at them, let m e provide some method details and context.

All tests were run on the SAME Machine.

A Toshiba Tecra M5 with 4 Gig of ram and a 60 Gig 7200 RPM Hard Drive.

Ubuntu 9 and Windows Server 2008 Standard were natively installed on 2 separate (but identical) hard drives.

The web servers were Apache2 on Linux and IIS 7 on Windows.

Both operating systems were fully patched / updated.

No Operating System or Development Runtime performance enhancements were added.

I wasn’t investigating how much speed an expert could custom tailor the tests to on a specific platform.

Yes, I could implement PHP Byte Caching, or for ASP.NET I could use Page Caching, Partial Page Caching, SQL Cache Dependency, Multi Threading, etc.

Both Windows and Linux Implementations of PHP will benefit from PHP Byte Code caching.

My goal was to determine the relative speed of THE IMPLEMENTATION.

I found the results both interesting and unexpected.

PHP on Linux Versus PHP on Windows…..

I really though one would just be faster than the other, but I was wrong. Some things are faster on Windows, other are faster on Linux.

  • RAW statement execution seems faster on Windows.
  • Function Calls were faster on Windows
  • Object Creation / Access was faster on Linux with PHP 5.2 but faster on Windows with 5.3
  • Library calls were faster on Linux. (Example: Encryption 3-5 times faster on Ubuntu.)
  • File Access is faster on Linux by a small percentage, except for file copy operations which was as much as 60% slower on Windows probably due to the ACL advanced security.
  • MySQL access with Linux is faster by more than a little and on Windows, MySQL access deteriorates in version 5.3 (This seems to be poor implementation, see PostgreSQL below.)
  • PostgreSQL performance is very close on both platforms (within 6/100 of a second for 1000 Operations) – It’s faster on Windows and faster still on Windows with PHP 5.3
  • MS SQL Server access from PHP 5.2 on Windows is marginally slower than MySQL access on Linux. (PHP 5.3 not yet supported at the time of this writing.)

So what does all that mean ?

  • We can probably say that in terms of raw execution – performance on Linux versus Windows is probably a wash (more or less equivalent) so that the performance of PHP itself becomes a moot factor in choosing Linux or Windows for PHP application deployment.
  • If you are building an application, or running an application that supports it, PostgreSQL might be a better database choice since it performs pretty much the same on Windows and Linux.
  • If you are running an application that locks you in to Sun Microsystems’ MySQL and you want to run it on Windows, your should do scale planning. (My personal guess is that it’s unlikely that Sun will markedly improve MySQL performance on Windows. )
  • Version 1 of the PHP Driver for SQL Server (V2 is in the works) is somewhat slower than MySQL or PostpreSQL but probably not enough to discourage use where diverse developer access is desired. (v2 ot the driver will improve performance. )

By and large I think the PHP team and the Microsoft IIS team have accomplished good raw performance equivalence across platforms. (Now we just need to get the Open Source Application teams (Drupal, WordPress, Joomle, etc.) to do performance optimization on both !)

PHP versus ASP.NET Raw Performance …..

By now you have cheated and looked at the spread sheet.

Yes, ASP.NET is universally faster than PHP (on Windows and on Linux) with the exceptions of File Copy and Attribute operations.

MySQL Access from PHP on Linux is a TINY bit faster than SQL Server access on Windows (assuming common data types and SELECT statements) but probably not enough to matter.

ASP.NET (C#) operations, object use, library calls, etc. are SIGNIFICANTLY faster that the PHP equivalents.

I know my PHP friends and the Linux dudes (and dude-etts) will probably come out of the wood work to refute my tests and results :)

I’ve always thought that if high end performance options were part of your needs requirements,  then .NET programming has some advanced options “out of the box” like multi-threading, asynchronous requests, and a number of caching options.

NOTE – I’m not saying “ASP.NET is Faster so you shouldn't choose PHP !!!!  I’ve always contended that the affable simplicity of PHP had some drawbacks for certain advanced applications. (Just as the early learning complexity of ASP.NET can have it’s drawbacks. )

To me (your mileage may vary) the exciting thing about PHP is not the language / platform so much as it is what thousands of clever PHP Developers have done with it (Drupal, Joomla, Wordpress, PHPBB, Nuke, etc.)

In any event, it’s nice to now have some data that PHP performance on Windows and Linux are “in the same ballpark”.

Now I can start writing those Windows specific PHP  libraries I’ve been dreaming about for years !!

COMMENT WARNING

  • I know some will be incensed by these tests. You are welcome to comment and disagree, but if you can't be polite I’ll simply delete your comments and block your IP address.
  • If you dislike the results and want to refute them – DO THE WORK. Accompany your dissent with DATA. Take my code or write your own and argue with FACTS.
Posted in: General asp.net | Tags: asp.net php windows linux implementation performance compare windows versus linux sql server postgresql ms sql server mysql

Best blog system – WordPress, using php and mysql

WordPress started in 2003 with a single bit of code to enhance the typography of everyday writing and with fewer users than you can count on your fingers and toes. Since then it has grown to be the largest self-hosted blogging tool in the world, used on millions of sites and seen by tens of millions of people every day.

Everything you see here, from the documentation to the code itself, was created by and for the community. WordPress is an Open Source project, which means there are hundreds of people all over the world working on it. (More than most commercial platforms.) It also means you are free to use it for anything from your cat’s home page to a Fortune 500 web site without paying anyone a license fee and a number of other important freedoms.
About WordPress.org

On this site you can download and install a software script called WordPress. To do this you need a web host who meets the minimum requirements and a little time. WordPress is completely customizable and can be used for almost anything. There is also a service called WordPress.com which lets you get started with a new and free WordPress-based blog in seconds, but varies in several ways and is less flexible than the WordPress you download and install yourself.
A Little History

WordPress was born out of a desire for an elegant, well-architectured personal publishing system built on PHP and MySQL and licensed under the GPL. It is the official successor of b2/cafelog. WordPress is fresh software, but its roots and development go back to 2001. It is a mature and stable product. We hope by focusing on user experience and web standards we can create a tool different from anything else out there.

2005 was a very exciting year for WordPress, as it saw the release of our 1.5 version (introduced themes) which was downloaded over 900,000 times, the start of hosted service WordPress.com to expand WP's reach, the founding of Automattic by several core members of the WP team, and finally the release of version 2.0.

After 1.5 we seemed to have something people really liked and we've experienced some fairly rapid growth. Here are some metrics for 2006 and 2007.

In 2006 we had 1,545,703 downloads, in 2007 we had 3,816,965!

As for plugins we had 191,567 downloads of 371 unique plugins in 2006. In 2007 there were 2,845,884 downloads (15x growth) of 1,384 plugins.

2006 saw the introduction of the first WordCamp in San Francisco.

In 2007 we adopted a regular release schedule, putting out major feature releases roughly every 3-4 months, or three times a year.

Because of the number of improvements in version 2.5 we took an extra 3 months on it, but 2008 looks on track to do three major releases again. It will be a very exciting year.

There are now dozens of WordCamps around the world, from Vancouver to Dallas to Milan, Italy.

To run WordPress your host just needs a couple of things:

    * PHP version 4.3 or greater
    * MySQL version 4.0 or greater

That's really it. We recommend Apache or Litespeed as the most robust and featureful server for running WordPress, but any server that supports PHP and MySQL will do. That said, we can’t test every possible environment and each of the hosts on our hosting page supports the above and more with no problems.

Key Features

    * Full standards compliance — We have gone to great lengths to make sure every bit of WordPress generated code is in full compliance with the standards of the W3C. This is important not only for interoperability with today's browser but also for forward compatibility with the tools of the next generation. Your web site is a beautiful thing, and you should demand nothing less.
    * No rebuilding — Changes you make to your templates or entries are reflected immediately on your site, with no need for regenerating static pages.
    * WordPress Pages — Pages allow you to manage non-blog content easily, so for example you could have a static "About" page that you manage through WordPress. For an idea of how powerful this is, the entire WordPress.org site could be run off WordPress alone. (We don't for technical mirroring reasons.)
    * WordPress Links -- Links allows you to create, maintain, and update any number of blogrolls through your administration interface. This is much faster than calling an external blogroll manager.
    * WordPress Themes — WordPress comes with a full theme system which makes designing everything from the simplest blog to the most complicated webzine a piece of cake, and you can even have multiple themes with totally different looks that you switch with a single click. Have a new design every day.
    * Cross-blog communication tools— WordPress fully supports both the Trackback and Pingback standards, and we are committed to supporting future standards as they develop.
    * Comments — Visitors to your site can leave comments on individual entries, and through Trackback or Pingback can comment on their own site. You can enable or disable comments on a per-post basis.
    * Spam protection — Out of the box WordPress comes with very robust tools such as an integrated blacklist and open proxy checker to manage and eliminate comment spam on your blog, and there is also a rich array of plugins that can take this functionality a step further.
    * Full user registration — WordPress has a built-in user registration system that (if you choose) can allow people to register and maintain profiles and leave authenticated comments on your blog. You can optionally close comments for non-registered users. There are also plugins that hide posts from lower level users.

    * Password Protected Posts — You can give passwords to individual posts to hide them from the public. You can also have private posts which are viewable only by their author.
    * Easy installation and upgrades — Installing WordPress and upgrading from previous versions and other software is a piece of cake. Try it and you'll wonder why all web software isn't this easy.
    * Easy Importing — We currently have importers for Movable Type, Textpattern, Greymatter, Blogger, and b2. Work on importers for Nucleus and pMachine are under way.
    * XML-RPC interface — WordPress currently supports an extended version of the Blogger API, MetaWeblog API, and finally the MovableType API. You can even use clients designed for other platforms like Zempt.
    * Workflow — You can have types of users that can only post drafts, not publish to the front page.
    * Typographical niceties — WordPress uses the Texturize engine to intelligently convert plain ASCII into typographically correct XHTML entities. This includes quotes, apostrophes, ellipses, em and en dashes, multiplication symbols, and ampersands. For information about the proper use of such entities see Peter Sheerin's article The Trouble With Em ’n En.
    * Intelligent text formatting — If you've dealt with systems that convert new lines to line breaks before you know why they have a bad name: if you have any sort of HTML they butcher it by putting tags after every new line indiscriminately, breaking your formatting and validation. Our function for this intelligently avoids places where you already have breaks and block-level HTML tags, so you can leave it on without worrying about it breaking your code.
    * Multiple authors — WordPress' highly advanced user system allows up to 10 levels of users, with different levels having different (and configurable) privileges with regard to publishing, editing, options, and other users.
    * Bookmarklets — Cross-browser bookmarklets make it easy to publish to your blog or add links to your blogroll with a minimum of effort.
    * Ping away — WordPress supports pinging Ping-O-Matic, which means maximum exposure for your blog to search engines.

Posted in: General | Tags: php mysql web application page feature wordpress blog website key feature link rebuilding

Introduction to apache .htaccess

What is .htaccesss?

.htaccess is a configuration file for use on web servers running the Apache Web Server software. When a .htaccess file is placed in a directory which is in turn 'loaded via the Apache Web Server', then the .htaccess file is detected and executed by the Apache Web Server software. These .htaccess files can be used to alter the configuration of the Apache Web Server software to enable/disable additional functionality and features that the Apache Web Server software has to offer. These facilities include basic redirect functionality, for instance if a 404 file not found error occurs, or for more advanced functions such as content password protection or image hot link prevention.

How to use .htaccess

'.htaccess' is the filename in full, it is not a file extension. For instance, you would not create a file called, 'file.htaccess', it is simply called, '.htaccess'. This file will take effect when placed in any directory which is then in turn loaded via the Apache Web Server software. The file will take effect over the entire directory it is placed in and all files and subdirectories within the specified directory.

You can create a .htaccess file using any good text editor such as TextPad, UltraEdit, Microsoft WordPad and similar (you cannot use Microsoft NotePad).
Companies are also now rolling out mobile phone units pre-equipped with text-editors, so if you happen to own one of those you can also use it to create .htaccess files.
Here is an example of what you might include in a .htaccess file.

AuthName "Member's Area Name"
AuthUserFile /path/to/password/file/.htpasswd
AuthType Basic
require valid-user
ErrorDocument 401 /error_pages/401.html
AddHandler server-parsed .html

This is a fairly advanced example: it enables password protection on the directory; it offers redirection to a custom error page if a user fails to login correctly; and it enables SSI (server side includes) for use with '.html' files. Please don't be put off, it's very simple once you gain a basic understanding and this article provides examples which are ready to go - simply copy, paste and customise. Examples are explained line by line so it is clear exactly what each line does and why you need it.

Once you have created a .htaccess file, which may look similar to the one shown above (or may simply contain one line), you need to upload it. This should be done using a FTP (file transfer protocol) program. You should already have one which you will have used to upload your web site content. If not, many are available free of charge from web sites such as 'Download.com' and we can recommend 'CuteFTP' and 'WSFTP'.

When uploading your .htaccess files, it is very important you upload the file in 'ASCII' mode. 'ASCII' and 'BINARY' are different methods of transferring data and it is important .htaccess files are transferred in 'ASCII' mode and not 'BINARY'. It is likely your FTP software will default to 'BINARY' so look for a 'Transfer Mode' or 'Transfer Type' option in the menus.

Upload the .htaccess file to the directory you would like it to take effect over. Now visit this directory using your web browser as you would for any other document on your web site and check it has worked correctly.

Note, when you upload your .htaccess file it may not appear in the directory listings for files on your web site. Do not worry; this means your server or FTP software is hiding them which should not be an issue.

A possible cause of error is if the file permissions on the .htaccess file are not set correctly. This only occurs on certain servers, but you may like to change the permissions on the file to '755' or 'executable'. You can do this with your FTP software, look for a 'File Permissions' or 'CHMOD' option, and input '0755'.

If your .htaccess file does not work, you should contact your system administrator or web hosting company and ensure they have enabled .htaccess within your account. Some web hosting companies do not allow use without permission. If errors persist, consult this article for advice, or contact your system administrator for advice.

Error documents


Creating custom error pages is very useful, it allows you to show web site visitors a friendly error message, for instance if a URL on your web site does not work. This avoids the unfriendly '404 File Not Found' error and allows you to display a friendly error, explaining possible solutions and guiding the visitor back into your web site content, rather than leaving them frustrated and lost.

To set-up custom error documents, create a .htaccess file following the main instructions and guidance which includes the following text:

ErrorDocument 404 /error_pages/404.html

The above line tells the Apache Web Server to display the document located at /error_pages/404.html (under your domain name/web site address) whenever a 404 (file not found) error occurs.

In this example, we have assumed you have created the error document and called it '404.html' and that you have placed it in a directory called 'error_pages' under your domain name. For example, http://www.yourdomain.com/error_pages/404.html

The document 404.html is a normal HTML document like the others in your web site and can display whatever content you wish, however we recommend including a 'File Not Found' message.

To setup further error documents, for example for '401 Unauthorised', '403 Forbidden', and '500 Internal Server' error messages, create a .htaccess file following the main instructions and guidance which includes the following text:

ErrorDocument 401 /error_pages/401.html
ErrorDocument 404 /error_pages/404.html
ErrorDocument 500 /error_pages/500.html

It's all very well displaying a friendly error message, but more importantly you need to resolve the error. By using a CGI script instead of a static HTML document as the error document allows us to record errors in a database, and resolve them.

This can be achieved very easily thanks to a variety of pre-made solutions which can even show us which errors are received most frequently. Such products can be found on The CGI Resource Index and HotScripts.com.

Redirects

Redirects enable us to direct web site visitors from one document within your web site to another. This is useful for example, if you have moved your web site content and would like to redirect visitors from old links to the new content location.

To set-up redirects, create a .htaccess file following the main instructions and guidance which includes the following text:

Redirect /old_dir/ http://www.yourdomain.com/new_dir/index.html

The above line tells the Apache Web Server that if a visitor requests a documents located in the directory 'old_dir', then to display the document 'index.html' located in the directory 'new_dir'.

You see in this example, the 'old_dir' is the location of the document to be requested by the visitor, and is a document or directory located under your main domain. In this example, the directory 'old_dir' would be located at 'http://www.yourdomain.com/old_dir/'. However, you will also notice the location of the file that the visitor is to be redirected to is a full web site URL, not what is referred to as a relative URL in the case of 'old_dir'. This means we can redirect visitors to the 'old_dir' folder to any web site document, it doesn't have to be held within your web site content and could be any web site.

It is very important (and the most common cause of error) that you understand the difference between a relative URL and an absolute/full URL. A relative URL is the location of the document within the web site, and does not include the actual domain name of the web site. These are used for documents held within the web site to simplify and shorten the URL. A absolute or full URL is one which includes the full domain name.

For example, for a absolute/full URL, ' http://www.yourdomain.com   /directory/file.html'. the relative URL for this document would be, '/directory/file.html'.

Disable directory listings

Preventing directory listings can be very useful if for example, you have a directory containing important '.zip' archive files or to prevent viewing of your image directories. Alternatively it can also be useful to enable directory listings if they are not available on your server, for example if you wish to display directory listings of your important '.zip' files.

To prevent directory listings, create a .htaccess file following the main instructions and guidance which includes the following text:

IndexIgnore *

The above lines tell the Apache Web Server to prevent directory listings of directories and files within the directory containing the .htaccess file. The '*' represents a wildcard, this means it will not display any files. It is possible to prevent listings of only certain file types, so for example you can show listings of '.html' files but not your '.zip' files.

To prevent listing '.zip' files, create a .htaccess file following the main instructions and guidance which includes the following text:

IndexIgnore *.zip

The above line tells the Apache Web Server to list all files except those that end with '.zip'.

To prevent listing multiple file types, create a .htaccess file following the main instructions and guidance which includes the following text:

IndexIgnore *.zip *.jpg *.gif

The above line tells the Apache Web Server to list all files except those that end with '.zip', '.jpg' or '.gif'.

Alternatively, if your server does not allow directory listings and you would like to enable them, create a .htaccess file following the main instructions and guidance which includes the following text:

Options +Indexes

The above line tells the Apache Web Server to enable directory listing within the directory containing this .htaccess file. You can also reverse this to disable directory listings by replacing the plus sign before the text 'Indexes' with a minus sign. e.g. 'Options -Indexes'.

You can also include a default description for the directory listings that is displayed at the top of the page by placing a file called 'HEADER' in the same directory. The contents of this file are displayed before the list of directory contents. You can also include a footer, by creating a file called 'README'. The contents of this file are displayed after the list of directory contents.

Demo

Enable Directory Browsing

Options +Indexes
## block a few types of files from showing
IndexIgnore *.wmv *.mp4 *.avi

Disable Directory Browsing

Options All -Indexes

Customize Error Messages

ErrorDocument 403 /forbidden.html
ErrorDocument 404 /notfound.html
ErrorDocument 500 /servererror.html

Get SSI working with HTML/SHTML

AddType text/html .html
AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .shtml
# AddHandler server-parsed .htm

Change Default Page (order is followed!)

DirectoryIndex myhome.htm index.htm index.php

Block Users from accessing the site

<limit GET POST PUT>
order deny,allow
deny from 202.54.122.33
deny from 8.70.44.53
deny from .spammers.com
allow from all
</limit>

Allow only LAN users

order deny,allow
deny from all
allow from 192.168.0.0/24

Redirect Visitors to New Page/Directory

Redirect oldpage.html http://www.domainname.com/newpage.html
Redirect /olddir http://www.domainname.com/newdir/

Block site from specific referrers

RewriteEngine on
RewriteCond %{HTTP_REFERER} site-to-block\.com [NC]
RewriteCond %{HTTP_REFERER} site-to-block-2\.com [NC]
RewriteRule .* - [F]

Block Hot Linking/Bandwidth hogging

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]

Want to show a “Stealing is Bad” message too?

Add this below the Hot Link Blocking code:

RewriteRule \.(gif|jpg)$ http://www.mydomain.com/dontsteal.gif [R,L]

Stop .htaccess (or any other file) from being viewed

<files file-name>
order allow,deny
deny from all
</files>

Avoid the 500 Error

# Avoid 500 error by passing charset
AddDefaultCharset utf-8

Grant CGI Access in a directory

Options +ExecCGI
AddHandler cgi-script cgi pl
# To enable all scripts in a directory use the following
# SetHandler cgi-script
Posted in: website seo | Tags: php htaccess introduction intro apache troubleshooting cgi redirects disable directory listing indexignore zip errordocument authtype require addhandler enable directory browsing ssi customize error messages change default page block hot linking bandwidth hogging block site 500 error grant

PHP interview questions and answers, from Yahoo!

1. Which of the following will not add john to the users array?

         1. $users[] = 'john';
         2. array_add($users,'john');
         3. array_push($users,'john');
         4. $users ||= 'john';

2. What’s the difference between sort(), assort() and ksort? Under what circumstances would you use each of these?

3. What would the following code print to the browser? Why?

      $num = 10;
      function multiply(){
            $num = $num * 10;
      }
      multiply();
      echo $num;

4. What is the difference between a reference and a regular variable? How do you pass by reference & why would you want to?

5. What functions can you use to add library code to the currently running script?

6. What is the difference between foo() & @foo()?

7. How do you debug a PHP application?

8. What does === do? What’s an example of something that will give true for ‘==’, but not ‘===’?

9. How would you declare a class named “myclass” ? with no methods or properties?

10. How would you create an object, which is an instance of ‘“myclass’??

11. How do you access and set properties of a class from within the class?

12. What is the difference between include & include_once? include & require?

13. What function would you use to redirect the browser to a new page?

         1. redir()
         2. header()
         3. location()
         4. redirect()

14. What function can you use to open a file for reading and writing?

         1. fget();
         2. file_open();
         3. fopen();
         4. open_file();

15. What’s the difference between mysql_fetch_row() and mysql_fetch_array()?

16. What does the following code do? Explain what’s going on there.

      $date='08/26/2003';
      print ereg_replace('“([0-9]+)/([0-9]+)/([0-9]+)'‚¬?,\\2/\\1/\\3,$date);

17. Given a line of text $string, how would you write a regular expression to strip all the HTML tags from it?

18. What’s the difference between the way PHP and Perl distinguish between arrays and hashes?

19. How can you get round the stateless nature of HTTP using PHP?

20. What does the GD library do?

21. Name a few ways to output (print) a block of HTML code in PHP?

22. Is PHP better than Perl? – Discuss.

Posted in: Interview Questions | Tags: interview questions and answers interview php yahoo sort ksort web foo

Top 10 Apache interview questions and answers

  1. On a fresh install, why does Apache have three config files - srm.conf, access.conf and httpd.conf? - The first two are remnants from the NCSA times, and generally you should be ok if you delete the first two, and stick with httpd.conf.
  2. What’s the command to stop Apache? - kill the specific process that httpd is running under, or killall httpd. If you have apachectl installed, use apachectl stop.
  3. What does apachectl graceful do? - It sends a SIGUSR1 for a restart, and starts the apache server if it’s not running.
  4. How do you check for the httpd.conf consistency and any errors in it? - apachectl configtest
  5. When I do ps -aux, why do I have one copy of httpd running as root and the rest as nouser? - You need to be a root to attach yourself to any Unix port below 1024, and we need 80.
  6. But I thought that running apache as a root is a security risk? - That one root process opens port 80, but never listens to it, so no user will actually enter the site with root rights. If you kill the root process, you will see the other kids disappear as well.
  7. Why do I get the message "… no listening sockets available, shutting down"? - In Apache 2 you need to have a listen directive. Just put Listen 80 in httpd.conf.
  8. What is ServerType directive? - It defines whether Apache should spawn itself as a child process (standalone) or keep everything in a single process (inetd). Keeping it inetd conserves resources. This is deprecated, however.
  9. What is mod_vhost_alias? - It allows hosting multiple sites on the same server via simpler configurations.
  10. What does htpasswd do? - It creates a new user in a specified group, and asks to specify a password for that user.
Posted in: Interview Questions | Tags: interview questions and answers interview php website apache interview questions apachectl graceful mod_vhost_alias htpasswd