{"id":53,"date":"2013-11-13T15:53:03","date_gmt":"2013-11-13T15:53:03","guid":{"rendered":"http:\/\/linux.mycustomcycle.com\/?p=53"},"modified":"2015-02-19T19:35:29","modified_gmt":"2015-02-19T19:35:29","slug":"apache","status":"publish","type":"post","link":"http:\/\/linux.suriyasuneel.com\/?p=53","title":{"rendered":"Apache"},"content":{"rendered":"<h3>php and mysql<\/h3>\n<p>install php5 php5-mysql to have support for php and mysql<\/p>\n<h2>Apache2<\/h2>\n<p>this apache2 configuration is very confusing. i guess i need to learn a lot and soon will update this page as i learn and have more time to update&#8230;<br \/>\n&#8230;&#8230;09\/09\/2007 10.10 pm the file that you need to edit are<br \/>\n\/etc\/apache2\/sites-enabled\/000-default<br \/>\n\/etc\/apache2\/apache2.conf<br \/>\nEdit the apache2.conf to add the virtual hosts Include \/etc\/apache2\/sites-enabled\/<br \/>\nedit the file 000-default which will be the default virtual host<br \/>\nWhat is favicon.ico<\/p>\n<p>I always wondered about the icons that is displayed in front of the url in the address bar and how to get it. But I never did anything to get that, as I thought that it is an advanced server setup. Recently I found out that there are so many error messages in my apache error_log that favicon.ico is not found. I thought that it is some file in my html code, so i tried to eliminate that line and to my surprise, there was none. Then as usual i googled for favicon.ico. Created one, without knowing what it is going to do and I was astonished when i saw the icon next to the url for my website. Not bad JC.<br \/>\n&#8212;&#8212;03\/18\/2005 8.25AM<br \/>\nVirtual Hosts and SubDomain<\/p>\n<p>Finally i got it working. I think may be I didn&#8217;t try that seriously last time. It has been my dream to develop sub-domains such as<br \/>\nHome Page http:\/\/jaya.homelinux.org<br \/>\nMusic Page http:\/\/music.jaya.homelinux.org<br \/>\nWe can do that with the help of Virtual hosts.<\/p>\n<p>DocumentRoot &lt;path_to_my_webdir&gt; Servername jaya.homelinux.org<\/p>\n<p>DocumentRoot &lt;path_to_my_webdir&gt;\/music<br \/>\nServername music.jaya.homelinux.org<\/p>\n<p>The important thing being the declaration of the main domain using virtual host which i missed in my earlier attempts.<br \/>\n&#8212;&#8212;&#8212;03\/09\/05 12.31 AM<br \/>\nInstall apache, php, mysql, perl<\/p>\n<p>My best advice is don&#8217;t install as rpm.<br \/>\nIf you need php, mysql, perl everything to work properly install in the following order.<br \/>\nDownload the sources from the respective websites<br \/>\nMysql<br \/>\nopenssl<br \/>\napache Apache<br \/>\ncurl curl.haxx.se<br \/>\nphp<br \/>\nmod_perl<br \/>\nDon&#8217;t worry about the mod_ssl package as that was included with apache up from apache2.<br \/>\nCompile and Install Apache<\/p>\n<p>Download the source tarball from the website and compile with the following options<br \/>\n.\/configure &#8211;enable-so &#8211;prefix=\/usr\/local\/apache &#8211;enable-ssl=shared<br \/>\nTo enable htaccess and htpasswd under the option Directory for the document root<br \/>\nOptions Indexes FollowSymLinks<br \/>\nAllowOverride Options FileInfo AuthConfig Limit<br \/>\nOrder allow, deny<br \/>\nAllow from all<br \/>\nTo enable CGI and Perl script execution, remove the # in front of AddHandler .cgi .pl<br \/>\n&#8212;&#8212;&#8212;-01-02-2003<br \/>\nCompile and Install Curl<\/p>\n<pre>\r\n.\/configure --with-ssl\r\nmake\r\nmake install\r\n<\/pre>\n<p>Compile and Install mod_perl<\/p>\n<pre>\r\nperl Makefile.PL USE_APXS=1 MP_APXS=\/usr\/local\/apache\/bin\/apxs EVERYTHING=1\r\nmake\r\nmake install\r\n<\/pre>\n<p>Edit httpd.conf<\/p>\n<pre>\r\n&lt; IfDefine SSL&gt;\r\nAddModule mod_ssl.c\r\n&lt; \/IfDefine&gt;\r\nAddModule mod_php4.c\r\nAddModule mod_perl.c\r\nUser nobody\r\nGroup nobody\r\n&lt; IfModule mod_dir.c&gt;\r\nDirectoryIndex index.html index.php\r\n&lt; IfModule&gt;\r\nAddType application\/x-httpd-php .php\r\n<\/pre>\n<p>Limiting access to websites<\/p>\n<p>First edit the httpd.conf as follows which will request apache to check the particular directory for the presence of .htaccess, instead of checking every directory it opens.<\/p>\n<pre>\r\n&lt; Directory the-directory-you-are-protecting&gt;\r\nOptions FollowSymLinks Indexes\r\nAllowOverride AuthConfig\r\n&lt; \/Directory &gt;\r\n<\/pre>\n<p>Restart the apache server.<br \/>\nCreate the .htpasswd file by using the following command<\/p>\n<pre>\r\n\/usr\/local\/apache\/bin\/htpasswd -c .htpasswd jaya\r\n<\/pre>\n<p>Copy that file to the DocumentRoot directory<br \/>\nCreate the .htaccess file to the folder that you want to protect<br \/>\nEnter the following and save as .htaccess<\/p>\n<pre>\r\nAuthUserFile \/usr\/local\/myweb\/.htpasswd\r\nAuthName \"Username and password required\"\r\nAuthType Basic\r\n&lt; Limit GET POST &gt;\r\nrequire user jaya\r\n&lt; \/Limit &gt;\r\nEnable CGI-bin\r\n<\/pre>\n<p>Open the httpd.conf and find this line #ScriptAlias \/cgi-bin\/ &#8220;\/usr\/local\/apache\/cgi-bin\/&#8221;<br \/>\nremove the # and also change the path to where you store your files find this line<\/p>\n<pre>\r\n#AddHandler cgi-script .cgi\r\n<\/pre>\n<p>and remove the #<br \/>\nEdit the Directory as follows<\/p>\n<pre>\r\n&lt; Directory \/usr\/local\/myweb\/cgi-bin &gt;\r\nAllowOverride None\r\nAllow None\r\n&lt; \/Directory &gt;\r\n<\/pre>\n<p>If you get an error that it could not spawn the child process make sure that the path to the perl executable is correct.<br \/>\nEnable directory listing<\/p>\n<p>Sometimes we wish to have a directory listing instead of showing the index.html or any files on startup. If you are the administrator for your then you can enable it by<br \/>\nOptions Indexes<br \/>\nin httpd.conf. If you don&#8217;t have access to the httpd.conf, then you can accomplish the adding the same in .htaccess files<br \/>\nForbidden Error #403 Blah Blah Blah<\/p>\n<p>If you get this error, first check the User\/Group option in the httpd.conf file. If it is set to nobody or blank, then smack yourself on your head or ask somebody else(who will be glad to do for you) and change it to some exisiting group\/user in your system, who owns the folders.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>php and mysql install php5 php5-mysql to have support for php and mysql Apache2 this apache2 configuration is very confusing. i guess i need to learn a lot and soon will update this page as i learn and have more time to update&#8230; &#8230;&#8230;09\/09\/2007 10.10 pm the file that you need to edit are \/etc\/apache2\/sites-enabled\/000-default [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=\/wp\/v2\/posts\/53"}],"collection":[{"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=53"}],"version-history":[{"count":3,"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=\/wp\/v2\/posts\/53\/revisions"}],"predecessor-version":[{"id":55,"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=\/wp\/v2\/posts\/53\/revisions\/55"}],"wp:attachment":[{"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}