Kurinchi Blogger Scribbles …


Jul 23
2015

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 .

Read more »


Jul 20
2015

First set up the httpd (web) service

$ yum install httpd

If httpd service is already installed, update the service

$ yum update httpd

Now, start the web server

$ service httpd start

Redirecting to /bin/systemctl start httpd.service

Check the status of the web server

$ service httpd status


Read more »


Jul 12
2015

First step is to install dependencies

$ sudo yum groupinstall “Development Tools”

$ sudo yum install kernel-devel

Mount the Virtualbox Additions CD ISO. You should download the virtualbox additions iso from http://download.virtualbox.org/virtualbox/ depending on your version of Virtual Box.

$ sudo mkdir /media/cdrom/

$ sudo mount /dev/cdrom /media/cdrom/

$ cd /media/cdrom

$ sudo ./VBoxLinuxAdditions.run

Before this step, create a shared folder in your host system. Say for example, if you created a shared folder named “CentosShare” in the host system you will follow the steps given below to access the share from within Centos.

$ mkdir ~/share

$ mount -t vboxs CentosShare ~/share


Jun 03
2015

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


May 23
2015

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

Read more »


Apr 15
2015

Edit /etc/php.ini and add the timezone setting within the file. For a list of timezone settings, visit http://php.net/manual/en/timezones.php


[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York


Apr 14
2015

Your answer is to create a robots.txt file in the root of your web directory and to have the code setting given below in the file.

User-agent: *
Disallow: /

You can read more about Robots exclusion protocol, here


Mar 30
2015

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


Feb 03
2015

Python: How to setup virtual environment?

Last updated: July 30th, 2015

Different projects in python may require different modules and its dependencies. Also, there may be a necessity that certain projects be run on newer/older python releases hence introducing version conflicts. Virtual environment is a tool that helps you manage these scenarios.

To install virtualenv, use pip

$ pip install virtualenv

Now, create a virtual environment “myenv”

$ virtualenv myenv

To use the virtual environment, key in

$ source myenv/bin/activate

(if in windows, key in “myenv\Scripts\activate“)

The name of your virtual environment will appear on the left of the prompt

(myenv) …$

To exit out of the virtual environment, key in

$ deactivate


Aug 09
2014

When trying to import large SQL dump, you often get the above message. Remedy for this issue is to increase the packet size of MySQL’s daemon by setting a packet size of max_allowed_packet. Sudo to your account and set the following

root $ mysql -u admin -p

mysql> set global net_buffer_length=1000000;

mysql> set global max_allowed_packet=1000000000;

In the command line, issue the command

$ mysql –max_allowed_packet=128M -uUSER -pPASSWORD database < database.sql.dump



Valid HTML 4.01 Strict  Valid HTML 4.01 Strict