Apache

Git: Reset local branch to make it the same as remote branch master

Go to your local repository in bash

$ git fetch origin

$ git reset –hard origin/master

To clean and remove untracked files and directories

$ git clean -fdx

Share

Django: Permission denied access to / because search permissions are missing on a component of the path

Possible reasons and solutions

i) SELinux settings enforcing a file serve

$ /etc/selinux/config

Change SELINUX = disabled within the file and check if this is the cause for the error

ii) Application directory under restricted user permission folder path

For example, configuring the django project inside /root folder and trying to serve those files via apache server (apache user).

Try changing the folder to a path that you think is good for allowing public access such /var/www or /opt/sites .
Continue Reading…

Share

How to set apache server error status codes for beginners

Edit Apache configuration file for your site setting. It may be httpd.conf or a virtual host file that ends with .conf specific to your site.

Add the below line with the host file and give the correct path for the error message page.

ErrorDocument 404 /404.html

If you do not want to create a custom page to showcase the error message, you can simply add the error message in the configuration file

ErrorDocument 404 “404 – Page not found.

Error status codes on the client side

400 – Bad Request
401 – Unauthorized
402 – Payment Required
403 – Forbidden
404 – Not Found
405 – Method Not Allowed
406 – Not Acceptable
407 – Proxy Authentication Required
408 – Request Timeout
409 – Conflict
410 – Gone
411 – Length Required
412 – Precondition Failed
413 – Request Entity Too Large
414 – Request-URI Too Long
415 – Unsupported Media Type
416 – Requested Range Not Satisfiable
417 – Expectation Failed

Error status codes shown from server

500 – Internal Server Error
501 – Not Implemented
502 – Bad Gateway
503 – Service Unavailable
504 – Gateway Timeout
505 – HTTP Version Not Supported

Share

Prominent apache status code and its meaning for beginners

Informational

100 – Continue
101 – Switching Protocols

Successful

200 – OK
201 – Created
202 – Accepted
203 – Non-Authoritative Information
204 – No Content
205 – Reset Content
206 – Partial Content

Redirection

300 – Multiple Choices
301 – Moved Permanently
302 – Found
303 – See Other
304 – Not Modified
305 – Use Proxy
307 – Temporary Redirect
Continue Reading…

Share

How to use different Python version with virtual environments?

Use the flag -p with virtualenv command to specify the python version that you would want to use

$ virtualenv -p /usr/bin/python/2.7

For windows environment, use

c:\> virtualenv –python=c:\Python27\python.exe myenv

Share

PHP Fatal error: Class ‘DOMDocument’ not found

When setting up applications such as Magento you may come across the error message “PHP Fatal error: Class ‘DOMDocument’ not found …” in your apache server log files

Reason for the error is missing log files. Issue the commands below to fix the issue

$ yum -y install php-xml php-devel

$ service httpd reload

Share

How to setup, install Apache, PHP and MySQL on Mac OS?

Apache server is installed by default on Mac. Access the configuration settings for Apache by going to

$ cd /etc/apache2/
$ vi httpd.conf

To enable php, edit httpd.conf and uncomment the line
#LoadModule php5_module libexec/apache2/libphp5.so

Uncomment other lines that you may want to load in your system. As you are enabling PHP in your system, you may want to change the DirectoryIndex to
DirectoryIndex index.php index.html

Default group/user settings inside Apache on Mac is _www:_www
Continue Reading…

Share

How to setup Apache Tomcat, Java on CentOS?

Below set of steps involve setting up Tomcat 6 on CentOS 5 with Java 1.6

Download Apache Tomcat

$ wget http://apache.parentingamerica.com/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.tar.gz

Go to opt/ folder and extract Tomcat

$ cd /opt

$ tar -xzf apache-tomcat-6.0.36.tar.gz

Create a tomcat user

$ useradd -d /opt/apache-tomcat-6.0.36/ tomcatuser

Change user permission on tomcat folder

$ chown -R tomcatuser:tomcatuser apache-tomcat-6.0.36
Continue Reading…

Share

Apache: How to deny access to a folder or file?

Add the following list of lines into .htaccess file or to vhost configuration file appropriate to the folder within the website

<Directory /securedata>
Order Deny,Allow
Deny from all
</Directory>

Same will be the case for denying files within directories

<Files ~ “\.ini$”>
Order allow,deny
Deny from all
</Files>

The above lines of code will be helpful for us to prevent .svn files, .ini files, .htaccess files, include files from display within Apache

Share

How to integrate Zend Framework with WordPress blog or Joomla website?

Follow the simple steps given below to integrate Zend framework with other applications like WordPress, Joomla and other such open source or custom web applications.

i) Setup your Zend framework application as usual.

ii) Set the document root of the Zend application to the public folder within Zend install

iii) Now setup a folder for your wordpress or joomla or custom application. Let us assume that we want to create a custom blog application. Create a folder “blog” within “public” folder. Inside blog folder, create two files – .htaccess and index.php. Code for the two files are given below
Continue Reading…

Share
Kurinchi Calendar
October 2018
M T W T F S S
« Oct    
1234567
891011121314
15161718192021
22232425262728
293031