Changing default Apache webroot in Ubuntu
By default the webroot for apache/php is in /var/www
To change this, say, to /home/user/workspace/public_html
1 Go to file: /etc/apache2/sites-available/default
2. Change the /var/www to /home/user/workspace/public_html – as simple as this!!
OR,
If you are changing root just to abscond some difficulty from your IDE or just for temporary purpose, you can use the symlik: just open your terminal and –
cd /home/user/workspace/public_html
ln -s /var/www/project project
See how you would solve these known algorithm problems
Flatten nested javascript arrayCheck if there are three numbers a, b, c giving a total T from array A
Implement Queue Using two Stacks – JavaScript algorithm
String Ordered Permutation Algorithm Problem
Finding missing numbers from billion sequential number list file
Implementing tokenizer and adding tokens to the linked list
Array reversal in Recurrsion
Kadane’s algorithm in C – Dynamic Programming
Find K Complementary numbers from array Java implementation
Find the pairs that makes K Complementary in the given array java solution
Vinny Benson
I am new to Ubuntu(Just installed it 3 hours ago), I have a problem, it wont let me edit the “default” file located in “etcapache2sites-available” as it is set to read only, but when i go to properties the permissions tab page is grayed out, how can i edit the file
gullele
Hello Vinny, Sorry, was busy these days and was not able to respond fast.
The problem is probably with the owner of the file. Some file in the Ubuntu would not be available to be edited unless you logged as root.
In your case you have two options to do:
1 is to log as root and edit it
2. to use sudo access
I will explain the second one as it is too easy
Step:
1. Go to Applications (if u have default Ubuntu theme, it would be on the top left menu) -> Accessories -> Terminal
2. On the terminal enter the following command:
Sudo gedit /etc/apache2/sites-available
3. You would be prompted for a password and enter the password
4. you would get the sites-available file in text editor.
*You can also change the owner of the file so that you can simply open it using the command chown, but it is not recommended to do that.
Let me know if this helped,
thanks