07 July, 2011

Change the DocumentRoot of Apache webserver (/var/www) in Debian / Ubuntu

The document root (also called as the web root) of the Apache web server is located at the /var/www directory by default. Document root is the place where we find all the web pages and server scripts. These files are loaded on the browsers when we type in a particular url to point to that server. 

The /var/www directory doesn't allow access for a user who doesn't have the root permission. It's a headache task to switch to the root mode by typing in the root password everytime even though you know the password, since you may have to change your webpages or scripts during its development stage  very frequently. So a better idea to avoid this problem is to change the default Document root directory to some other location which doesn't require root permission for access.


Change it dude !!!
- - - - - - - - - - - - - - - - - -#

Inorder to change the document root,

#1. Make a directory somewhere inside your home directory to use as the Document root. (not necessarily be home... you can make it anywhere). I named it 'www'

$ mkdir /home/jo/www

#2. Now we have to edit the one of the configuration file of the Apache webserver. The file is located @  /etc/apache2/sites-available/default (requires root permission to edit it).

$ sudo gedit /etc/apache2/sites-available/default

The file will be opened up in the gedit text editor. Now you have to edit the DocumentRoot directive in this file. Replace the /var/www with the /path/to/your/new/document/root in the lines 4 and 9 as shown in the figure below.


#3. Restart the apache webserver.

$ sudo /etc/init.d/apache2  restart



Now test it !!!
- - - - - - - - - - - - - - - - - -#

#1. Create a html/php file inside the Document Root directory (mine is @ /home/jo/www).

#2. Take the terminal and navigate to the Document Root directory (using cd command). Use chmod command given below to allow read+write+execute permission to all.

$ chmod 777 *

#3. Take your web browser and type in http://localhost and hit the enter key! The apache server will load the contents of your Document Root directory as in the figure.


Hope you have done it right!!!


Read rest of entry

17 May, 2011

Access the blocked websites [facebook, orkut, youtube] using free http proxy servers

Atlast that too happened. Ban  for facebook on the computer lab,  Damn proxyserver !! They first blocked youtube, then orkut, then torrents and now it's facebook's turn... Then how do a man live without all this things in such a technically overflooding world?

I can't agree with their policies... I want to talk, i want to chat and i want to tweet.. Squid proxy server was running on the network. It was powerful and configured well to block everything out of the rule. Then i started googling for a way to bring the blocked facebook onto my laptop within the same network, and found that some free http proxy servers outside the network will help me.Also port 80 (HTTP) was open, so that i can browse the internet.

What actually happens in the network when i am behind my college's proxy server is, whenever a url request for facebook comes from my browser, the proxy server which has been configured to capture such requests comes into action. But since we are allowed to browse on the internet, its clear that you can access servers other than facebook. Most of the free http proxy mechanisms work on this trick. They help you to cheat the squid server. Squid server beleive that your machine and the free proxy server  on the internet (may be in US, Europe ) are the two endpoints of communication. See the image below to see how that http proxy server loads the facebook page on your machine  [check the url area and the content area in the image]



Here the free http proxy server (faceoxy.com in image) communicate with the facebook server on behalf of you and serves the packets from the facebook within faceoxy's header. That was somewhat literally!!!  So when the squid program analyses the packets, it can not find any traces of the facebook in the source/destination address feilds of the ip packets. I am not going to the advanced details of http tunneling, another post is on its way...


List of the free and reliable http proxy servers that help you to access blocked websites such as facebook, orkut, youtube etc.. are : Though they are classified most of the sites serves facilities such as 
  • anonymous browsing
  • proxy bypassing
  • changing network location of your machine

HideMyAss.com – Free Anonymous Proxy Servers

Proxy.org – Directory of free proxy servers.

GlobalPandora – They give you a proxy address to add to your browsers netwrok settings

http://blockedsiteaccess.com/


 
facebook  



http://facebookoxy.com/

http://www.faceoxy.com/



youtube proxy


Megabypass

Youtubeproxy

MegaProxy 


proxybin.com
 
Another best trick that works well with these condition is the foxyproxy addon for firefox. Just install the addon for your firefox. FoxyProxy automatically switches an internet connection across one or more proxy servers based on URL patterns. Simply, it automates the manual process of editing Firefox's Connection Settings dialog. Proxy server switching occurs based on the loading URL and the switching rules you define...
Read rest of entry

26 April, 2010

Internet access and package installation behind a proxy server in Ubuntu

When there is a proxy server in between your system and server you have to specify the proxy address in all the applications that is intended to access internet such as firefox, bittorrent... Proxy servers are mainly deployed for subnets, for example a network inside a college is connected to internet using a proxy server (not technically, since there are gateways,routers...) to sensor and restrict the students internet activities, protect from unauthorized access... 

If you have to run any application behind a proxy server, you have to specify the proxy server address and the port number to the application that need access the internet. This is because the default port numbers used by the transport  layer protocols are changed by the proxy server. Squid is one among the important proxy programs that is prefered by network administrators. In the following cases please replace the proxy address and port number with the corresponding feilds applicable to you.

Setting Proxy address in Mozilla  firefox

Click on edit --> Preferences.

Select the Network tab under the advanced tab. Click on the Settings button. In the Network settings window select the manual configuration. Then enter the HTTP proxy and port on the current window. Save the settings...When you start browsing the firefox will automatically ask for authentication. Then you have to specify the username and password in the proxy server. 






Setting Proxy in Synaptic package manager


If you are using synaptic package manager as the package installer, You have to do some configuration before using apt package manager.
Click on the Settings --> Preferences
Choose the network tab and select manual proxy configuration. Set HTTP proxy and FTP proxy. Then enter their port numbers also. Click on the authentication button to set username and password.




Setting proxy for APT package manager
APT is a command line utility for installing packages. Probably many people are addicted to terminal do the following . . .

If you have no authentication for the proxy server then use the following command line. 

export http_proxy=http://192.168.0.2:3128
export ftp_proxy=http://192.168.0.2:3128


If you have username and password the use

export http_proxy=http://username:password@192.168.0.2:3128/
export ftp_proxy=http://username:password@192.168.0.2:3128/
Read rest of entry
 

Terminal Diary | techblog Copyright © 2009 Gadget Blog is Designed by jintu jacob Powered by Blogger