0

I'm creating a web page, and have a Linux server, a friend create to me a folder in user document, called www.

He says that I make the changes in that folder.

He toll me:

I created a symbolic link of www folder in user documents, and appear a sky blue directory.

Today I wanted updated my server www folder with new files and I delete the www foIder and copy the new one with the changes, this directory don't have the sky blue color.

When I access to the website the changes don't appear, even the new files not are recognized, how can I recover the www folder for see the new changes?

Update

/var/www/cgi-bin:
total 0

/var/www/html:
total 44
-rw-r--r-- 1 root root   229 May 15 12:28 400.shtml
-rw-r--r-- 1 root root   207 May 15 12:28 401.shtml
-rw-r--r-- 1 root root   203 May 15 12:28 403.shtml
-rw-r--r-- 1 root root   204 May 15 12:28 404.shtml
-rw-r--r-- 1 root root   216 May 15 12:28 413.shtml
-rw-r--r-- 1 root root   243 May 15 12:28 500.shtml
-rw-r--r-- 1 root root 10404 May 15 12:28 cp_errordocument.shtml
-rw-r--r-- 1 root root   111 May 15 12:28 index.html
drwxr-xr-x 2 root root  4096 Aug 19 13:44 suspended.page

Update2

[myserver2017@blu ~]$ ls -l
total 40
lrwxrwxrwx  1 myserver2017 myserver2017   40 Aug 19 14:20 access-logs -> /etc/apache2/logs/domlogs/myserver2017
drwxr-x---  3 myserver2017 mail           4096 Aug 19 14:26 etc
drwx------  2 myserver2017 myserver2017 4096 Aug 21 08:03 logs
drwxr-x--x 10 myserver2017 myserver2017 4096 Aug 19 14:02 mail
drwxrwxr-x  2 myserver2017 myserver2017 4096 Aug 23 11:54 perl5
drwxr-x---  3 myserver2017 myserver2017 4096 Aug 19 14:02 public_ftp
drwxr-x--- 11 myserver2017 myserver2017 4096 Aug 26 10:24 public_html
drwxrwxr-x  4 myserver2017 myserver2017 4096 Aug 23 13:32 back-www
drwxr-xr-x  5 myserver2017 myserver2017 4096 Aug 26 03:44 ssl
drwxr-xr-x  6 myserver2017 myserver2017 4096 Aug 19 14:36 tmp
drwsr-sr-x  8 myserver2017 myserver2017 4096 Aug 26 10:53 www2
Dev 200
  • 105
  • 1
  • 1
  • 8
  • This could be a simple permission's error. Post the output of the following command: `sudo ls -l /var/www/*` – Kris Stadler Aug 26 '17 at 15:11
  • @KrisStadler ready man, i deleted the www folder and created new one, but the second dont have the sky blue color of the first, i cant find where put the new files, or recover the www sky blue folder, also i have a access-logs folder with sky blue, that help to find the address of the web page folder? – Dev 200 Aug 26 '17 at 15:20
  • @KrisStadler i added the ls -l command in my user folder, see that access-logs have a -> with other folder. i search and found that the sky blue is something like a symbolic link? – Dev 200 Aug 26 '17 at 15:26
  • Yes, I was just about to post about how to do a symbolic link. [This article](https://askubuntu.com/questions/17299/what-do-the-different-colors-mean-in-ls) explains what the different colors mean when creating symbolic links. – Kris Stadler Aug 26 '17 at 15:28
  • @KrisStadler how i know where is the www folder of my web page to create the symbolic? – Dev 200 Aug 26 '17 at 15:30

1 Answers1

1

This can be solved by creating a new symbolic link between your two folders. The ln command takes in two parameters: <real folder directory> and <linked folder directory>. The <linked folder directory> will be /var/www/ in this case.

Assuming that the www folder located in your user's documents is the <real folder directory> go ahead and create the symbolic link with: sudo ln -s /home/user/Documents/www/folder-with-web-content /var/www/

Kris Stadler
  • 159
  • 9
  • after i deleted the www(skyblue) folder, the webpage still appear, i guest that the real folder directory is somewhere?, and the new www folder is in usr/www – Dev 200 Aug 26 '17 at 15:43
  • It could aslo be that your apache virtual host is serving the content from another directory. – Kris Stadler Aug 26 '17 at 15:44
  • how can i get that directory?. – Dev 200 Aug 26 '17 at 15:44
  • after delete www, i copied all elements in www(sky blue) and work. can we find the directory using access-logs directory? because the access-logs is in sky blue and he is a link file – Dev 200 Aug 26 '17 at 15:46
  • `/etc/apache2/logs/domlogs/myserver2017` – Dev 200 Aug 26 '17 at 15:47
  • Ok so you need to open your site's virtual host config file. Going to assume your website is example.com. You need to open the config and take note of the `DocumentRoot` value. To open the file run: `sudo nano /etc/apache2/sites-available/example.com.conf` – Kris Stadler Aug 26 '17 at 15:49
  • in the documentroot is the path of the webpage? and later i can do something like this: `ln -s /home/myserver2017/www PATH` – Dev 200 Aug 26 '17 at 15:54
  • Yes, the `DocumentRoot` points to the folder that contains all the content `Apache2` servers to the client on request. – Kris Stadler Aug 26 '17 at 15:57
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/64478/discussion-between-victor-random-and-kris-stadler). – Dev 200 Aug 26 '17 at 15:59