1
script_fu
suPHP, Xoops, CBB & Extgallery to name a few. Chmod problems 777 to 755

Hello,

I have a new server running suPHP that requires all files and folders to be set at 755 & 644 and below. I don't think there is a workaround but I must ask to be sure.

Extgallery is reporting...

-----

Public original path

public_html/uploads/extgallery/public-photo/original) : Not Writable

Public original path

public_html/uploads/extgallery/public-photo/large) : Not Writable

Public original path

public_html/uploads/extgallery/public-photo/medium) : Not Writable

Public original path

public_html/uploads/extgallery/public-photo/thumb) : Not Writable

-----

Cbb 3.08 is reporting...

Path for attachment storing:

public_html/uploads/newbb/ ( Available )

Path for attached image thumbs:

public_html/uploads/newbb/thumbs/ ( Not writable Set the permission )

-----

These are just a few things I have found thats going to cause me problems... God only knows what else will...

Is there a workaround?

2
jlm69
Re: suPHP, Xoops, CBB & Extgallery to name a few. Chmod problems 777 to 755
  • 2008/2/6 21:38

  • jlm69

  • Module Developer

  • Posts: 719

  • Since: 2002/7/19


Billy,

My server has phpsuexec on it also, and I have cbb 3.08 installed on it and last week I tried extgallery, and I don't have these problems. A better way of saying it is all folders are 755 and all files are 644 and mainfile.php is 444. Double check to make sure the folders permissions are 755.

Is this a hosted server?

John

3
script_fu
Re: suPHP, Xoops, CBB & Extgallery to name a few. Chmod problems 777 to 755

Quote:

jlm69 wrote:
Billy,

My server has phpsuexec on it also, and I have cbb 3.08 installed on it and last week I tried extgallery, and I don't have these problems. A better way of saying it is all folders are 755 and all files are 644 and mainfile.php is 444. Double check to make sure the folders permissions are 755.

Is this a hosted server?

John


Hey John,

How are you? I hope well...

Yes the server is at JaguarPc.

See this thread...

http://www.jaguarpc.com/forums/showthread.php?t=19222

Based on what im learning and you know that I can be slow at times lol. Suphp and phpsuexec are two different handlers for php 5. My server comes pre installed with 3. Cgi, dso, suphp and none. I can pick any handler that I want to use.

The server was setup straight from them with

Apache/2.0.63 (Unix)
PHP Version 5.2.5
Mysql 5.0.45 Community

Phpsuexec is considered to be php in .cgi mode. Now suphp is something totally different. But yet still has alot of phpsuexe features. I haven't learned a lot about it yet but I will get there.

Anyway I have everything set like you said and cbb and extgallery do not have write permissions in suphp mode.

I have phpsuexec as well but the company is pushing suphp they really like it. Like I said it came pre installed as the default.

The tech guy swears that the folders don't have to be 777 either.

Now here is another issue when Will ported some of the sites over from servint last night. I had owner problems "root owns" this and "nobody owns" that when the domain should own it.

So still need to nail down who owns what for XOOPS to work correctly. And in saying that... that might be where my problem lays.

At least that where im starting to think my problem might be.

Any ideas you have always help!

4
zyspec
Re: suPHP, Xoops, CBB & Extgallery to name a few. Chmod problems 777 to 755
  • 2008/2/6 23:14

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


I believe you're right - it's a file ownership problem, not a directory CHMOD problem... I recently went through this with a webhosting company re: phpsuexec. This is especially true for systems that have gone through a migration from PHP installed as a module to phpsuexec tranformation. phpsuexec does not like 'nobody' as the owner and therefore will inhibit writing to the directory/file - this is one of the reasons admins like phpsuexec since it puts your stuff into it's own 'sandbox', thus increasing overall server security.

You will have to get your hosting company to set the file ownership via CHOWN to work correctly.

5
script_fu
Re: suPHP, Xoops, CBB & Extgallery to name a few. Chmod problems 777 to 755

Yep they just confirmed that every time I login as root and do anything. I am messing up owner permissions. So I have a couple ways to go on this. Im going to try and stick with this new handler suphp. So I get to brush up on all my ssh commands and break out putty.

Anybody have a nice fresh list of ssh commands. I have an older list I will post up. Im sure some stuff has change on it...

6
script_fu
Re: suPHP, Xoops, CBB & Extgallery to name a few. Chmod problems 777 to 755

This is an old old list I made back in the 1xx days!
Im sure the same command is on this list 3 times.

Anyway

cd/home/mydomain/public_html/

cd/homeCtrl + C - End current command

tar -cpzf filename.tar.gz - Tar the current directory
Replace "filename" with an appropriate name.

tar -xzf xoops.tar.gz - Untar a file
Replace "filename" with the file's name.

wget http://www.website.com/file.tar.gz - Download a file to the server
Replace "http://www.website.com/file.tar.gz" with the location to the file.

cd /home/username - Navigate into a directory on the server (~ Navigate to your home directory, you can use "~" as part of the path: cd ~/public_html.
Replace "/home/username" with the appropriate directory.

------------------------------------------
SSH Commands - List
>>>> PLEASE CONTINUE TO ADD TO THIS LIST <<<<<

Here are a few commands that may be of interest to someone. Handy to print and save.

If you have more, please add.

ls Displays everything in the current directory
ls -a Displays all files, including hidden
ls -l Displays all files, along with the size and timestamp
tar -zxpf Uncompresses tar.gz files
tar -xpf Uncompresses .tar files
gunzip Uncompresses .gz files
cp Copies a file to a new file
mv Moves a file to a new file, or rename
mkdir Creates a directory
rmdir Deletes a directory
rm Deletes a file
rm -rf Deletes a directory
cd Moves to a directory
cd .. Moves to a lower directory
cd ~ Moves to your home directory
cd - Moves to the previous directory
pwd Displays the current directory
pico Edits a file
ftp Connect to a FTP server
lynx View a webpage
df Displays the hard drive stats
quota Displays your quota
uptime Displays the uptime of the server
uname -a Displays the operating system stats
whoami Displays your info
who Displays others connected to the server
last Displays the last login
whereis Tells where a file is located
BitchX IRC Client
mail Check your email
ps -x Displays processes your running
ps -a Displays all processes running
ps -ux Displays running processes, with CPU/Memory usage
kill Kills a process
kill -9 Kills an eggdrop process
killall Kills all running process of the same type
whatis Description of commands
man Displays help on the command
nano Same as Pico
Top - gives an overall view of what is going on with the server including memory usage, serve load and running processes "q" to exit top
sar -q gives a report of the process list, 1 minute and 5 minute average load every 10 minutes since midnight server time
tar -zcf filename.tar.gz file
Tars up the file or directory of your choice, replace filename.tar.gz with the name you want your tar file to have...with the tar.gz extension on the end and replace file with the file or directory you want to tar up. Can also use a path/to/file for both.
updatedb - Updates the locate/search DB.

netstat -n -p
Useful to see who is connected to your server, this also resolves hostnames to IP addresses and the -p switch shows you what each person connected is doing and provides a PID for it if there is one... useful if you need to kill something

find / -user username
Replace username with a username of one of your account to find all the files that belong to them. Also useful to add the |more switch so you can scroll one screen at a time. Ever have a client who seems to show a lot more files than are actually in their home directory? This is how you find those files and fix them. Common problem is cpmove files that don't get properly deleted and get added to a users account.

/scripts/pkgacct2 username
Replace username with a user on your system. This should be done from the home directory. Useful for manually backing up an account if whm copy account doesn't work. Then just move (mv) the file to a home directory accessible via the web and
chown user.user filename
and chmod to 750 or 755 and you can wget it from a different server if need be.

/scripts/restorepkg username
Once you've got the file and need to unpack it you use this command. The file should be in the /home directory to use this though. Remember folks.... username.... not cpmove-username.tar.gz

crontab -e
edit the crontab file and see what is set to run in there.

--help
Such as tar --help, similar to man it digs up info on any given command.

tail -10 filename
gives you the last 10 lines of a file. Can change the # to whatever you want.


Couple of Brians now

cp -R fileordirectory path/to/destination.
the -R allows you to copy an entire directory to somewhere else.

kill -9
not just for eggdrops... it's called a "hard kill" and handy for killing off any stubborn process that refuses to die.

whereis
can also use locate or find (although locate is faster)

killall
not just for killing programs.. you can also killall to kill all processes being run by a user. Handy if you have an abuser eating up system resources.


RESTART SERVICES:

service (service name) restart

Stop a service:
service (service name) stop

Start a service:
service (service name) start

Status (doesn't work on all):
service (service name) status

On a RedHat CPanel server, here are the useful services:
bandmin
chkservd
cpanel
crond
exim
httpd
mysql
named
proftpd

CRON INFO:
Root crontab:

crontab -e

To edit a users cron jobs

crontab -u username -e

Replace username with the actual username of the client you want to edit.


Regards,

Brian

More Commands
/scripts/adddns Add a Dns Entry
/scripts/addfpmail Install Frontpage Mail Exts
/scripts/addservlets Add JavaServlets to an account (jsp plugin required)
/scripts/adduser Add a User
/scripts/admin Run WHM Lite
/scripts/apachelimits Add Rlimits (cpu and mem limits) to apache.
/scripts/dnstransfer Resync with a master DNS Server
/scripts/editquota Edit A User's Quota
/scripts/finddev Search For Trojans in /dev
/scripts/findtrojans Locate Trojan Horses
Suggest Usage
/scripts/findtrojans < /var/log/trojans
/scripts/fixtrojans < /var/log/trojans
/scripts/fixcartwithsuexec Make Interchange work with suexec
/scripts/fixinterchange Fix Most Problems with Interchange
/scripts/fixtrojans Run on a trojans horse file created by findtrojans to remove them
/scripts/fixwebalizer Run this if a user's stats stop working
/scripts/fixvaliases Fix a broken valias file
/scripts/hdparamify Turn on DMA and 32bit IDE hard drive access (once per boot)
/scripts/initquotas Re-scan quotas. Usually fixes Disk space display problems
/scripts/initsuexec Turn on SUEXEC (probably a bad idea)
/scripts/installzendopt Fetch + Install Zend Optimizer
/scripts/ipusage Display Ipusage Report
/scripts/killacct Terminate an Account
/scripts/killbadrpms Delete \"Security Problem Infested RPMS\"
/scripts/mailperm Fix Various Mail Permission Problems
/scripts/mailtroubleshoot Attempt to Troubleshoot a Mail Problem
/scripts/mysqlpasswd Change a MySQL Password
/scripts/quicksecure Kill Potential Security Problem Services
/scripts/rebuildippool Rebuild Ip Address Pool
/scripts/remdefssl Delete Nasty SSL entry in apache default httpd.conf
/scripts/restartsrv Restart a Service (valid services: httpd,proftpd,exim,sshd,cppop,bind,mysql)
/scripts/rpmup Syncup Security Updates from RedHat/Mandrake
/scripts/runlogsnow Force a webalizer/analog update.
/scripts/secureit Remove non-important suid binaries
/scripts/setupfp4 Install Frontpage 4+ on an account.
/scripts/simpleps Return a Simple process list. Useful for finding where cgi scripts are running from.
/scripts/suspendacct Suspend an account
/scripts/sysup Syncup Cpanel RPM Updates
/scripts/ulimitnamed RH 6 only. Install a version of bind to handle many many zones.
/scripts/unblockip Unblock an IP
/scripts/unsuspendacct UnSuspend an account
/scripts/upcp Update Cpanel
/scripts/updatenow Update /scripts
/scripts/wwwacct Create a New Account

***
NEW

Block IP With IP Tables:
iptables -I INPUT -s 111.111.111.111 -j DROP

List blocked IP's in IP Tables:
iptables -L

Unblock IP in IP Tables:
iptables -D INPUT "Line # "

FOr the one above you just count how many lines from the top the address is you want to unblock. You put that number in the place of "Line # " You do not use quotes also.

vpsstat -s Shows your resource usage.
***

Laters

More.....

alias:Allows you to set aliases and view the current aliases.
awk:Search for a pattern within a file.
alien:Converts .tgz and rpm's to .deb format.
banner:Prints characters as a poster.
badblocks:Searches a device for bad blocks.
biff:Turns mail notification on and off.
bg:Used to move a job running in the foreground to the background.
bzip2:Used to compress and decompress files. Similar to gzip.
cardctl:Used to control PCMCIA cards.
cfdisk:Used to partition a hard disk.
chattr:Changes the attributes of a file or folder.
chroot:Change the root directory for a command.
chmod:Used to change permissions on a directory or file.
chown: Used to change the owner of a file or directory.
chgrp:Used to change the group a file belongs to.
clear:Clears the screen
cpio:Copies file archives from or to disks or tapes. Used for backing up.
catisplays the content of a file
chpasswd:Used to change a large number of passwords at once.
cd:Changes directories.
chage:Sets password aging parameters.
calisplays a calendar.
cron:Used to execute commands at a certain time.
crontab:Allows you to view or edit the current cron jobs.
dselect:A graphical front end for dpkg.
dpkg:Installs packages on debain distro's.
date:Prints current date to the screen
du:Lists disk usage in a directory.
df:Reports disk usage information. df -h will show you how much used/free space you have remaining in megabytes.
dmesg:Used to view the kernel boot file.
dump:Used for backing up.
edquota:Sets quotas for specific users.
env:Lists current environment variables.
fdisk:Used to create/edit/delete partitions.
fsck:Checks a file system for consistency.
fg:Used to send jobs to the background.
fuser:Checks to see what processes and users have open files.
free:Will show total memory, used memory, and free memory. -m will show it in megabytes instead of kilobytes
gcc:Used to compile C, Assembler, and Preprocessed C source files.
gpasswd:Used to set a password for a group.
grep:Used to search through a file for a specified pattern.
getty:Set terminal type, modes, speed, and line discipline
groupadd:Create new group account.
groupdel: Deletes a group.
groupmod:Used to modify a group.
groups:Shows what groups a user is part of.
gunzip:Uncompress files compressed by gzip.
head: Displays the first 10 lines of a file to the screen.
hdparm:Gets disk information.
history:Lists recently executed commands.
host:Used to get DNS info.
htpasswd:Allows you to set usernames and passwords for your websever.
id: Display information about yourself or another user.
insmod:Installs modules. To install a module, you would specify the path to the module.
init:Used to change run levels.
isapnp:Sets up ISA cards according to info found in the isapnp.conf file.
icmpinfo:Intercept and interpret ICMP packets
jobs:Used to show jobs running in the background.
join:Join lines of two sorted files by matching on a common field.
kill:Used to kill a process.
killall:Kill processes by command name.
kernelcfg:A graphical application that allows you to configure the kernel in X.
klogd:Control which kernel messages are displayed on the console; prioritize all messages, and log them through syslogd.
linuxconf:A command line GUI which lets you configure your linux box.
lpc:Used to control a line printer.
lpq:View the print spool queue.
lpr:Send files to the printer spool queue.
ln:Used to create hard and symbolic links.
less: Display the contents of a file
locate:Search for a file or directory (uses the locate database)
ldd:Shows what shared libraries a program is dependent on.
ldconfig:Used to configure/view shared libraries.
last:Lists logins and reboots.
lastlog:Print the last login times for system accounts.
lsmod:Lists loaded modules.
lsattr:Lists the attributes for a file or folder.
logrotate:Used to manipulate log files.
mount:Used by itself, reports the currently mounted files.
modinfo:Give info about the module.
modprobe:Queries modules.
man: Displays the Man page for a given command. Use it to find out more about a command such as syntx, arguments, and options. Example : man chmod
mesg:Used to allow/not allow 'write' messages to your terminal.
manpath:Attempts to determine the path to a man page.
mail:Used to send and receive mail.
mkdir:Make directory
mke2fs:Used to format a partition with the Ext2 file system.
merge:Merge multiple files together.
more:Lets you page through text one screen full at a time.
minicom:Great utility for troublshooting a modem.
mkbootdisk:Used to make a boot disk.
ntsysv:Used to select what services should automatically start.
nice:Used to set process priorities.
nslookup:Used to get DNS info from name servers.
netstat:Shows active sockets, print the protocol, the number of bytes waiting to be received, the number of bytes to be sent, the port number, the remote address and port, and the state of the socket.
ps: Displays current processes
ping:Used to test connectivity between two hosts.
pwconv:Used to set up the /etc/shadow file.
pnpdumpetermines settings for existing ISA cards.
quota:Allows users to view their own disk quotas.
quotaon:Turns on disk quotas for the system.
quotaoff:Turns off disk quotas for the system.
repquota:Provides reports of disk usage for various users.
rmmod:Removes modules. Just specify the name of the module you want removed like this- rmmod joystick
rpm: RedHat flavors only)Used to install RPM's
rpcinfo:Used to see what rpc services are available on the machine.
route:Used to view/change routes between you and other hosts.
smbclient:Used to connect to Windows shares or Samba shares on a linux machine.
smbadduser:Maps linux user names to Windows NT user names.
smbpasswd:Used to update the smbpasswd file with new accounts.
set:Used to read and write variables.
setquota:Used to set disk quotas.
sort:Sorts lines in a file by alphabetical order.
sndconfig:Used to probe and configure a sound card.
su:Change to Super User (root).
spell:Checks for spelling errors in a file.
startx:Start the X Server (GUI)
shutdown:Shutdown machine
suspend:Places a shell in the background.
showmount:Shows mount information for an NFS server.
swapon:Turns on the swapfile.
swapoff:Turns off the swapfile.
testparm:Used to troubleshoot Samba.
tar:Used to compress multiple files/directories into one file. Also used to "untar".
timeconfig:Used to set the timezone on your machine.
tac:View a file from the last line up.
touch:Creates an empty file or updates access time for an existing file.
tail: Displays the last 10 lines of a file to the screen.
talk:Used to chat with another user on the same machine.
tr:Converts one set of characters to another.
traceroute:Used to track the path a packet takes to a host.
top:Shows information about the most CPU-intensive processes.
useradd:Add a user.
usermod:Modify a user.
userdel: Delete a user.
umount:Removes a device from the filesystem.
updatedb:Updates the locate database (locate database will update automatically every sooften. This will force an update. You sometimes want to update the database manually after installing or moving software).
uname: Determines OS name, version and machine name.
vmstat:Lists information on memory usage.
vi:A text editor
whereis:Finds documentation files, source, and binary for a command.
who:Tells you who is logged into your server.
whoami:Tells you your user information.
wc:Print the number of bytes, words, and lines in files
which:Finds the full path for a command.
write:Used to send a message to another user on the same machine.
whois:Used to query servers for info on domains and IP addresses.
wall:Writes a message to all logged in users.
xman:Graphical interface for man pages.
xf86config:Used to configure X.
zcat:Read files that have been compressed with gzip.
pwd:shows what your current directory is - giving the full path.
ls: Displays a directories contents.
ls -al:lists filenames + information.
ls -alR:lists filenames + information in all subdirectories.
ls -alR | more:lists filenames + information in all subdirectories, pausing : when the screen become full.
ls *.html:lists all files ending with .html.
ls -d */:lists all directories within current directory.
rm [filename]:delete a file.
rm *:delete all files in your current directory.
rm *.html:delete all files ending in .html in your current directory.
ls -alR > result.txt:lists filenames + information in all subdirectories, and ouputs the results to a file instead of the screen.
ls -al /home/usr/bob/:lists files + info for /home/usr/bob.
mkdir [directoryname]:creates a new directory.
rmdir [directoryname]:remove a directory if it is empty.
rm -r [directoryname]:remove a directory and all files in it.
mv [old name] [new name]:move/rename a file.
cp [filename] [new filename]:copy a file.
find / -name [filename] -print:search the whole server for a file.
find . -name [filename] -print:search for a file starting with the current directory.
sed s/[oldtext]/[newtext]/g [filename]:searches file and replaces all occurances of [oldtext] with [newtext].
cp -r [directoryname] [new directoryname]:copy a directory and all files/directories in it.
find / -name [directoryname] - type d -print:search the whole server for a direcory.


--------------------------------------


mysql -u[Username] -p[Password] [Database Name] < filename.sql - Dump a SQL file into a MySQL database. Note the "<".
Replace "[Username]" with the database username (generally controlpaneluser_databaseuser). Replace "[Password]" with the database password and replace "[Database Name]" with the database name. Finally change "filename.sql" to the correct filename/location.

mysql -u[Username] -p[Password] [Database Name] > filename.sql - Dump a MySQL database to a SQL file. Note the ">".
Replace "[Username]" with the database username (generally controlpaneluser_databaseuser). Replace "[Password]" with the database password and replace "[Database Name]" with the database name. Finally change "filename.sql" to the correct filename/location.

ls - Directory listing

whereis function - The easiest way to find the actual path to perl, sendmail, etc
Replace "function" with the function name e.g. "sendmail".

rm - Remove/delete (use rm -r to delete recursive directories. Type "rm --help" for full help!)


mkdir directory_name - Make directory
Replace "directory_name" with the directory you want to create' name.

chmod - Change CHMOD settings

For example "chmod -c 777 file.txt" would change the CHMOD of file.txt to 777.

man command - view documentation on command


grep string file - search for string inside file


more file - display contents of file


cat file - display contents of file

ln -s real/path [link name] - create a symlink to a path

Replace "real/path" with the physical (real) path to the file. For example /home/user/downloads. Also replace "[link name]" with what you would like the symlink to be called. To remove the sym link use "rm [link name]".



chown username:usergroup file.txt - Change File Ownership/Group

Replace "username" with the username that is to become the new owner and "usergroup" respectively.



man (command) - shows help on a specific command

Replace "(command)" with the command you want help on e.g. "man pico".



pico (filename) - easy to use text editor to edit files

Replace "(filename)" with the filename to open e.g. "pico file.txt"



pine - easy to use mailer


more (file) - views a file, pausing every screen full

Replace "(file)" with the file name


passwd - change password

Example "passwd abc" would change your password to "abc"



du -ms /home/ - displays a summary of how man megs are used

Replace etc. accordingly



tail -f /usr/local/apache/logs/error_log - view a listing or errors on the fly



cp -p /source /dest - copies file from source to destination (the -p flag retains permissions)

Replace "/source" with the source of the file and "/dest" with the appropriate destination of the file




Another possible resource that gets good reviews from my boss:
http://www.ucgbook.com/

I believe the default shell is bash.

To add to MrHerald's fine list, I believer you should be able to add --help to and of those commands to get additional parameters.

For example:
ls --help
that should give you some additional arguments for the list command.

I like to alternate between
ls -al
ls -a

For fun you can also checkout:
top
(press q to quit when done)

pwd
displays your location (print working directory)

cd
(this will return you to your home directory if all you type is "cd" and press enter)

touch
creates an empty file
[example] touch myfile.txt

uptime
displays the uptime

hostname
displays the network name of your server

finger
displays a list of the users logged into the host

who
I forget what this does

ps
displays your running processes

kill
to kill a hung process
(kill -9 to stop right away)

mysqldump
used to backup your MySQL databases
[example backup]
mysqldump --add-drop-table -uYourUserName -pYourPassword YourDatabaseName > backup-file.sql

gzip
use for compressing files
[example]
gzip -9 filename

nice
used to set your process to different levels
[example]
nice -n 19 gzip mydatabase.sql

This will run the gzip process at the lowest priority on the host. I highly recommend using nice -n 19 whenever you have CPU intensive commands. Reason being is that it is polite to the other members on your server.

Login

Who's Online

349 user(s) are online (268 user(s) are browsing Support Forums)


Members: 0


Guests: 349


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits