Summary:
DRUPAL WEBSITE PERMISSIONS FIX (UNIX/LINUX)
Problem or Goal:
Recommended steps to fix the website file/folder
permissions
Cause:
File Permission issues on drupal
Solution:
# 1. Create a new example user.
useradd -s /bin/bash -m example;
# 2. Now add that user to the Apache group. On Ubuntu/Debian this group is usually
# called www-data, on CentOS it's usually apache.
usermod -a -G www-data example;
# 3. Set up a password for this user.
passwd example;
# 4. Now set the group to the Apache group. -R means recursive, and -v means
# verbose mode.
chgrp -Rv www-data sites/default/files
# 5. Next we'll set up permissions so that the web server can always write to any
# file that is in this directory. We do this by using 2775 in our chmod command.
# The 2 means that the group id will be preserved for any new files created in this
# directory. What that means is that www--data will always be the group on any files,
# thereby ensuring that web server and the user will both always have write
# permissions to any new files that are placed in this directory.
chmod 2775 sites/default/files
# 6. If there are any existing files in this directory, be sure the web server has
# write perms on them.
chmod g+w -R sites/default/files
# 7. Ensure that all users only have read permissions.
chmod 444 sites/default/settings.php
# ------------------------------------------------------
Problem Solved?
Yes, Comment if there are any questions.
“It has become appallingly obvious that our technology has exceeded our humanity.” Albert Einstein
Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts
Monday, May 2, 2016
Monday, November 24, 2014
snmpwalk -v bash: snmpwalk: command not found yet Net-Snmp is successfully installed
I already have Net-Snmp installed on my server but couldn't run any snmp commands!
Problem:
# snmpwalk -v
bash: snmpwalk: command not found
#
Solution:
The problem is that the snmp binaries are not listed in my system's environment PATH!
# find / -name snmpwalk
/usr/sfw/bin/snmpwalk
/usr/local/bin/snmpwalk
/tmp/net-snmp-5.4.4/apps/.libs/snmpwalk
/tmp/net-snmp-5.4.4/apps/snmpwalk
/tmp/net-snmp-5.4.4/win32/snmpwalk
#
#echo $PATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,Netra-240/sbin:/opt/sun/bin:/opt/SUNWexplo/bin:/opt/SUNWsneep/bin:/opt/CTEact/bin
So i added the PATH "/usr/local/bin" to my system's environment PATH:
export PATH=$PATH:/usr/local/bin
#echo $PATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,Netra-240/sbin:/opt/sun/bin:/opt/SUNWexplo/bin:/opt/SUNWsneep/bin:/opt/CTEact/bin:/usr/local/bin
#snmpwalk -V
NET-SNMP version: 5.4.4
#
To make the environment PATH persistent through system restarts, follow these steps:
Problem:
# snmpwalk -v
bash: snmpwalk: command not found
#
Solution:
The problem is that the snmp binaries are not listed in my system's environment PATH!
# find / -name snmpwalk
/usr/sfw/bin/snmpwalk
/usr/local/bin/snmpwalk
/tmp/net-snmp-5.4.4/apps/.libs/snmpwalk
/tmp/net-snmp-5.4.4/apps/snmpwalk
/tmp/net-snmp-5.4.4/win32/snmpwalk
#
#echo $PATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,Netra-240/sbin:/opt/sun/bin:/opt/SUNWexplo/bin:/opt/SUNWsneep/bin:/opt/CTEact/bin
So i added the PATH "/usr/local/bin" to my system's environment PATH:
export PATH=$PATH:/usr/local/bin
#echo $PATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,Netra-240/sbin:/opt/sun/bin:/opt/SUNWexplo/bin:/opt/SUNWsneep/bin:/opt/CTEact/bin:/usr/local/bin
#snmpwalk -V
NET-SNMP version: 5.4.4
#
To make the environment PATH persistent through system restarts, follow these steps:
- vi /etc/profile
- PATH=/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,Netra-240/sbin:/opt/sun/bin:/opt/SUNWexplo/bin:/opt/SUNWsneep/bin:/opt/CTEact/bin:/usr/local/bin
- source /etc/profile
- #echo $PATH
ld.so.1: snmpwalk: fatal: libgcc_s.so.1: open failed: No such file or directory Killed
I had just finished installing net-snmp on one of my old DNS server to help me monitor it remotely using cacti but i ran into this error while trying to test it using snmpwalk.
Problem:
# snmpwalk -V
ld.so.1: snmpwalk: fatal: libgcc_s.so.1: open failed: No such file or directory
Killed
#
Solution:
1. I ran a search to try and find this library, and yes libgcc was already installed on my server:
# find / -name libgcc*
/usr/local/lib/libgcc_s.so
/usr/local/lib/libgcc_s.so.1
2. So i checked my library PATH, and the path to libgcc wasn't there:
# echo $LD_LIBRARY_PATH
/usr/openwin/lib
#
3. I added it:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
4. Check again:
# echo $LD_LIBRARY_PATH
/usr/local/lib:/usr/openwin/lib
#
5. Test snmpwalk again:
# snmpwalk -V
NET-SNMP version: 5.4.4
6. To make the library PATH persistent, do the following:
Edit the /etc/profile file:
Problem:
# snmpwalk -V
ld.so.1: snmpwalk: fatal: libgcc_s.so.1: open failed: No such file or directory
Killed
#
Solution:
1. I ran a search to try and find this library, and yes libgcc was already installed on my server:
# find / -name libgcc*
/usr/local/lib/libgcc_s.so
/usr/local/lib/libgcc_s.so.1
2. So i checked my library PATH, and the path to libgcc wasn't there:
# echo $LD_LIBRARY_PATH
/usr/openwin/lib
#
3. I added it:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
4. Check again:
# echo $LD_LIBRARY_PATH
/usr/local/lib:/usr/openwin/lib
#
5. Test snmpwalk again:
# snmpwalk -V
NET-SNMP version: 5.4.4
6. To make the library PATH persistent, do the following:
Edit the /etc/profile file:
- vi /etc/profile
- LD_LIBRARY_PATH=/usr/local/lib:/usr/openwin/lib
- source /etc/profile
- #echo $LD_LIBRARY_PATH
Tuesday, November 18, 2014
How to gracefully restart unix/solaris server?
Telecommunication applications system servers usually run critical applications that require graceful restart rather than just running a #reboot or #shutdown.
The command below will gracefully restart the server.
#sync;sync;sync;sync
#shutdown -y -g0 -i6
The command below will gracefully restart the server.
#sync;sync;sync;sync
#shutdown -y -g0 -i6
Saturday, May 17, 2014
TCP Dump - WireShark Capture/Snoop on a Unix/Linux interface - Free Script
Here is a free tool to capture live packets on a Unix/Linux interface and analyze the captured packets using WireShark.
Simple Procedure:
1. Download the tcpdump tool here
2. Unzip the file
3. Transfer the file to the server whose interface you want to snoop
4. You might want to change the file permissions to make it executable (command: #chmod 777 file_name)
5. Identify the interface name that you want to snoop (command: #ifconfig -a)
6. Run the script: ./tcpdump -i eth88 -s 0 -w filename.cap
where:
Simple Procedure:
1. Download the tcpdump tool here
2. Unzip the file
3. Transfer the file to the server whose interface you want to snoop
4. You might want to change the file permissions to make it executable (command: #chmod 777 file_name)
5. Identify the interface name that you want to snoop (command: #ifconfig -a)
6. Run the script: ./tcpdump -i eth88 -s 0 -w filename.cap
where:
- -i eth88 refers to the specified listening network interface.
- -s 0 indicates that the message length is not limited. By default, 1,024 bytes is captured from each packet.
- -w filename.cap directly writes the packet into the file without analysis or printout. replace filename with the actual name of the file.
Thursday, November 7, 2013
Subscribe to:
Posts (Atom)
