Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25

Thread: Apache server hell - help!

  1. #21
    FLAC
    Join Date
    May 2006
    Location
    Calgary, Alberta
    Posts
    1,718
    Is bugbyte your root user? If you're using rights elevation to gain access to the permissions for that user then it's only going to keep you logged in like that for 15 minutes.

    Can you take a step back and explain exactly what you're trying to do? Maybe I have another way.
    Ampie Case
    2.5" Hard Drive 80GB Samsung 5400RPM
    256 MB DDR2 PC5400
    Xenarc 700TSV - VGA Monitor
    Intel D945GCLF Motherboard
    M2-ATX-HV

    2005 Honda Civic

  2. #22
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,359
    Blog Entries
    2
    I've got it working now, but still have some type of login permissions problem.

    Here's how it's setup:

    1. root user is....root.
    2. Only one other user is on the setup: /home/bugbyte
    3. I setup the server when I was logged in as root.
    4. The server originally pointed to /mysite
    5. I changed it to /var/www on the root user account
    6. I decided that I ought to do it right and switched it to point at /bugbyt/var/www
    7. That was when the fun began.

    Currently I can log in as root from some machines in my house but not from others, which is really weird because I never had that problem before. In fact, it is the opposite of the problem I posted about earlier where I could log in as root from everywhere but not as bugbyte without the server closing the connection.
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    Want to:
    -Find out about the new iBug iPad install?
    -Find out about carPC's in just 5 minutes? View the Car PC 101 video

  3. #23
    Newbie
    Join Date
    Nov 2008
    Posts
    12
    Quote Originally Posted by Bugbyte View Post
    Currently I can log in as root from some machines in my house but not from others, which is really weird because I never had that problem before. In fact, it is the opposite of the problem I posted about earlier where I could log in as root from everywhere but not as bugbyte without the server closing the connection.
    Hey BugByte, not sure if you're still having problems with this, but I have a few suggestions for you, since you're using Ubuntu, or some derivative of it.

    Generally by default, most SSH installs block root from logging in, since it's a huge security risk, plus Ubuntu actually generates a random password for the root user, and without setting it yourself (which I'm guessing you've done), you wouldn't be able to login anyways. I'm guessing the reason you can only access some of your machines as root is because this setting has been changed on a few of them, but not all of them.

    There's a couple methods of getting a root shell, or at least root permissions, with an admin user account on Ubuntu:

    1) sudo - From a regular user prompt, you can type 'sudo <command>' to run a command as another user. It basically stands for switch user and do command. By default, if you don't specify the user to run the command as, it will be run as root. It'll ask you for your password (to prove it's actually you sitting at the computer, and not someone who just walked up), and then execute the command.

    2) sudo -i - Adding the -i flag, which is short for --interactive, spawns a new shell as the root user. Unfortunately, this changes the directory you're currently in to that users home directory, which can sometimes be a pain.

    3) sudo su - This one is actually a derivative of #1. Basically you're sudoing the su command, which stands for switch user. By default, if you don't specify the user you want to switch to, you get the root user. The nice thing about this one is that it will use your same shell process, so you'll remain in the directory you were already in.


    There are only a couple reasons I can think of to not run everything as root in home environment (where security isn't really essential).
    a) so you don't accidentally screw something up when you rm a file or the like.
    b) when you create files as root, the default owner/group is set to the root user/group, so you wouldn't be able to access the file as your regular user account without fixing the permissions.

    So it's not a huge issue to run things as the root user all the time, as long as you're somewhat careful with the commands you're running.

    If you're still having other issues with your setup, give me a shout, but I have a few suggestions below.

    Also, just wondering, but is there a chance you're confusing /home/bugbyte/var/www and /bugbyte/var/www ? I'm guessing not, but you never know.



    Suggestions:

    Apache is generally installed with permissions for the www-data user on Ubuntu (you can check this in the /etc/apache2/envvars file).

    Here's a few things you can try, if the user is www-data (and change www-data to the appropriate user/group for your system if not):

    The following command will set the owner user/group to www-data for your directory:
    Code:
    $ sudo chown -R www-data:www-data /bugbyte/var/www
    The next command, is the one that I think might actually fix your issue. This command basically gives read/listing access to everyone to your directory. This may be a security issue if other people who have access to the computer shouldn't be viewing what's in this directory (I would recommend making sure the permissions on those files are secure).
    Code:
    $ sudo chmod a+r /bugbyte
    $ sudo chmod a+r /bugbyte/var
    $ sudo chmod a+r /bugbyte/var/www
    If that doesn't fix it, well, this should fix the permissions of all the files in the directory:

    The following commands are a little more complicated, they go to your root website directory, and then find all the directories (-type d), and files (-type f), and execute a command on each file. The commands change the permissions for each item.
    chmod 775 sets read/write/execute permissions for owners, and groups, and read/execute permissions for everyone else on the directory.
    chmod 664 sets read/write permissions for owners and groups, and
    Code:
    ~ $ cd /bugbyte/var/www
    www $ sudo find . -type d -exec chmod 775 {} \;
    www $ sudo find . -type f -exec chmod 664 {} \;
    Again, if you are still having issues let me know, but this thread hasn't been updated in a month or two now, so you might be okay.

  4. #24
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,359
    Blog Entries
    2
    Wow! Thanks for the detailed info, that was great!

    I did finally solve the issue and it was a permissions problem just like you pointed out at the end. And...I probably was confusing /home/bugbyte with /bugbyte/var. I'm pretty new a Linux.

    I think I used chmod 755 or something like that, which is, I think the equivalent of the a+r?

    Thanks again for the reply!
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    Want to:
    -Find out about the new iBug iPad install?
    -Find out about carPC's in just 5 minutes? View the Car PC 101 video

  5. #25
    Newbie
    Join Date
    Nov 2008
    Posts
    12
    Awesome, that's good to hear!

    755 is rwx for user, and rx for group and everyone else.

    r being read, w being write. x is a little tricky, as for files it means execute (in linux you can set any file to execute, and it will try as best it can...generally this is done for shell scripts and binary files though). For directories though, from Wikipedia: "When set for a directory, [execute] grants the ability to traverse its tree in order to access files or subdirectories, but not see files inside the directory (unless read is set)."

    Basically setting that bit allows apache to access the files, but not list the directory contents, so it keeps your directory more secure.

    Edit: a similar way of doing that would be to first cancel all permissions with

    $ chmod a-rwx <dir>

    Then add back rx to all
    $ chmod a+rx <dir>

    Then add write permissions for the user:
    $ chmod u+w <dir>

    That's why the numbers are faster once you get used to them, you can set all the permissions with a single command.



    Actually, I don't think you did confuse the two, if you are using /bugbyte.
    I know on my personal server I've setup my website in:
    /var/www/blackaura

    That's generally how I've seen it, or, some people will do:
    /home/<username>/public_html
    (on the server you would access that as http://www.domain.com/~<username>/)

    So that's why I thought I'd ask.

Page 3 of 3 FirstFirst 123

Similar Threads

  1. GPSTracker on home server
    By lambosprit in forum GPS
    Replies: 319
    Last Post: 07-12-2012, 06:35 PM
  2. Lilliput screen on Ubuntu
    By yam125 in forum Linux
    Replies: 13
    Last Post: 06-13-2011, 11:19 AM
  3. XBOX + Apache v2.6 + M1-ATX = problems?
    By arionl in forum Power Supplies
    Replies: 10
    Last Post: 07-18-2006, 12:46 PM
  4. Windows Server
    By Quattro in forum Off Topic
    Replies: 11
    Last Post: 04-18-2006, 12:22 AM
  5. File/web/print Server
    By Quattro in forum Off Topic
    Replies: 7
    Last Post: 04-15-2005, 10:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •