PDA

View Full Version : Westhost Hacks: Tips and Tricks



jalal
11-05-2003, 11:56 AM
There have been so many good tips and tricks posted to this forum, that I've tried to pull some of them together in one place.

If you have any to add, any corrections to make, I'd welcome any input.

http://www.gnomedia.com/cw/westhost/

Enjoy!

wildjokerdesign
11-06-2003, 11:07 PM
Thank you jalal!

REC-WH
11-07-2003, 08:23 AM
There have been so many good tips and tricks posted to this forum, that I've tried to pull some of them together in one place.

If you have any to add, any corrections to make, I'd welcome any input.

http://www.gnomedia.com/cw/westhost/

Enjoy!
Super! Thanks! Also thanks to all the people who have taken the time to provide so much information & advice!

Charlie

Skullman
12-21-2003, 09:12 AM
First of all, congratulations for such a good resource page.

Regarding to this forum, I'm totally new at Webhost and the things that I have read over here seems to be very cool.

I want you to ask something about the site you've created: You say that's possible to customize the prompt of the shell, for that there are two files:

/.bashrc and /.profile

The second one is a link to the first one, so the one I need to change is the .bashrc one. But, when I try to edit it on Vi, it says that's a read only file, and I'm not able to chmod it, because the owner is 'root', not my user.

┐How is it possible to edit the file and make the changes you tell on the prompt and aliases?

Cheers!

jalal
12-21-2003, 12:31 PM
There are a couple of different layouts of the file/directory structure on Westhost V2, they seem to have been changing things as they go along.
On early sites, the file '~/.bashrc' is owned by root, but it is, in reality, just a symlink to the real file '/.bashrc' which should be owned by you and editable. So try:
$ vi /.bashrc
and see if that works.

On later sites, it seems like they have made /.bashrc itself owned by root... so I'm not sure what to do about that. :(

I'll have to update the web page, thanks for drawing that to my attention.

jalal
12-21-2003, 03:11 PM
I've entered a support ticket asking if this can be changed back, or if there is a good reason for it.

I'm a bit annoyed that recent sites don't let me customize the shell...

8)

Skullman
12-22-2003, 02:45 AM
Here is the directory listing of my / folder:



[myuser][/]$ ls -la
drwx--x--x myuser vuser .
drwx--x--x myuser vuser ..
-rw------- myuser vuser .bash_history
-rw-r--r-- root root .bashrc
lrwxrwxrwx root root .profile -> .bashrc
dr-xr-xr-x root root bin
drwxr-xr-x root root dev
drwxr-xr-x myuser vuser etc
drwxr-xr-x myuser vuser ftp
lrwxrwxrwx root root home -> usr/home


I have deleted some information, and leaved you only the filename and privileges. This way you can see the differences between both, the old and new ones...

Thanks for your help,

jalal
12-22-2003, 02:08 PM
Well, the response for my support ticket was that they have changed my .bashrc to be owned by the site owner. Which it was anyway!!! (so i'm not sure what they did).

So, if you file a support ticket, they will change the ownership for you. I'm trying to get them to make that the default for new sites created under Westhost2. Lets see if that is possible.

jalal
12-22-2003, 02:56 PM
I've asked them to make the change a default one, and the tech I emailed said that it was planned to be that way.
So, lets see.

Skullman
12-23-2003, 10:33 AM
I've asked the support to make this change yesterday (Sunday), and now it's just changed to my user :)

Very very nice support. I like Westhost a little bit more every day... They rule!

Jalal, thank you for your help. Cheers!

---
Skullman (Going to make his Bash colourfull) :wink:

WestHost - RSimpkins
01-14-2004, 05:33 PM
Here is a nice trick. You have execute permissions. Do the following steps:

cd /
mv .bashrc .bashrc.old
cp .bashrc.old .bashrc

Then you end up with a .bashrc owned by you.

Doing this with other things could break your VPS significantly, so be careful what you do.

Please let me know if anyone has problems with this.

Corrado Fiore
05-18-2008, 07:43 AM
Hello,

does the above trick (mv and then cp a root-owned file) work also under WH 3.0? I tried, but I got a "operation not permitted" error. Maybe I'm missing something...

Thanks,
Corrado Fiore

dattas
06-01-2008, 12:11 PM
In 3.0 the file is owned by you by default, it is its permissions (-rw-r--r--) that is not letting you move the file.