5

The > file operator opens the file for writing but truncates it initially. That means that each new > file causes the content of the file to be replaced. If you'd want the myErrors.txt to contain the error of all the commands, you'd need either to open that file only once, or use > the first time and >> the other times (which opens the file ...


5

Admin access in Wordpress gives complete control over the Wordpress settings, content, users, etc. (including exporting it all, e.g., via a backup). I believe it also allows execution of arbitrary code as whatever user Wordpress runs under (likely the web server user), e.g., via installing a Wordpress extension. I believe a Wordpress theme contains of PHP ...


4

Noel, www-data user is the user, from whose behalf Apache runs your WordPress code (and any other code, generating Web pages for your users, e.g. Django code - python web-site engine). www-data user is created to have minimal permissions possible, because it can possibly execute malicious code and take as much control over your system, as it is allowed to ...


4

Just change the own of the folder from root to your current user. sudo chown -R yourcurrentuser:currentgroup /srv/www/htdocs/wordpress


4

If wp-config.php doesn't exist yet, use: cp wp-config-sample.php wp-config.php The group that apache uses is in an Apache config file. Here's how I find in on OS X. for me, the group is _www: grep ^Group /etc/apache2/httpd.conf There are 3 permissions groups that Unix/Linux uses - user, group, others. I'm assuming you'll want to remain the user that owns ...


4

According to the Debian package page for wordpress, it appears that lighttpd should satisfy the dependency. However, it also requires libapache2-mod-php5 or php5, which is why I think it still pulls in Apache: while you have installed lighttpd, you may have forgotten to install the matching PHP package. Make sure lighttpd and php5 are both installed before ...


4

The series of commands that you mention in the question does not add carriage-returns (the ^M things) to your text file. However, if the file already had carriage-returns at the end of each line, which all DOS text files have, then it would have added non-DOS lines to the file, which means that the text file, after editing, has some lines that are Unix text ...


3

If you want to do it for files only in your current directory: for file in $(ls *.php); do echo "define('DISABLE_WP_CRON', true)" >> $file; done If you want to do it for all php files starting from your current directory: for file in $(find . -type f -name "*.php"); do echo "define('DISABLE_WP_CRON', true)" >> $file; done Or probably you want ...


3

nullfs can be used to give a jail read-only access to parts of the host's file system. All the jails live within the host's file system, so the idea of jail-to-jail access is moot. On my system (and I do jails the hard way) I have the following directive in /etc/jails.conf: mount.fstab = "/etc/fstab.${name}"; which means I have separate fstabs for each ...


3

msql.so is not the PHP extension for MySQL. Try enabling the correct module (php_mysql) and trying again.


3

I may be missing something, but this looks simple: $ cd /var/www/html $ for dir in * do chown -R "$dir:$dir" "$dir" done If you’re concerned about the correctness of these commands, you can insert the word echo before chown, e.g., $ cd /var/www/html $ for dir in * do echo chown -R "$dir:$dir" "$dir" done to have it tell you what chown commands it ...


3

You can use curly braces to group a block and redirect all the output: for dir in public_html/*/; do if pushd "$dir"; then { wp plugin update --all wp core update wp language core update wp theme update --all } 2>myErrors.txt popd fi done


3

You could do it with find, but you could also use a shell loop: for dir in /home2/blogname/* do [ -d "$dir"/public_html/wp-content/plugins/better-wp-security ] || printf '%s is missing a public_html/wp-content/plugins/better-wp-security directory\n' "$dir" done With GNU find: find /home2/blogname -mindepth 1 -maxdepth 1 -exec sh -c \ 'test ! -d "$1"/...


2

You would have been better off with the www directory at /var/www, with owner www-data and group www-data, and adding your user to the www-data group. First, change the DocumentRoot etc back to /var/www in the apache config. The /var/www directory (and all subdirectories in it) should be setgid, so that files and dirs are created with group www-data. All ...


2

Assuming that you're running WP on top of a MySQL database, and that your table prefix is wp_, then you'll want to run a query like: UPDATE wp_posts SET post_content = REPLACE(REPLACE(post_content, '[bash]', '<pre>'), '[/bash]', '</pre>') WHERE post_content LIKE '%[bash]%' Take a backup first, just in case! mysqldump -h hostname -u username -p ...


2

The installation of Apache may appears to be running as root but in actuality it's running as the user apache. You can check this by looking in this file: $ grep "^User" /etc/httpd/conf/httpd.conf User apache Your entire wordpress directory should likely be owned by this user if you're planning on managing the installation using wordpress through the web ...


2

The .htaccess file modifies apache settings based on the file system location, where you want to change settings based on the virtual host context. So instead of setting up authentication in the .htaccess file, modify the Apache configuration file and add authentication settings to the correct virtual host entry: <VirtualHost *:80> ServerName www....


2

A url linking to file:/// will try to access that file on the user's PC, not the server. You must link to the file directly through the filesystem as your server allows, whether that be with a relative path ../../srv/protected/book1.pdf or absolute /srv/protected/book1.pdf Make sure your DOCUMENT_ROOT in Apache is setup in a way that will allow these ...


2

You can use two command line options to unzip to get your desired result, provided the zip contains no sub directories. unzip -j -d /my-test-site wordpress-4.1.1.zip Note that if your zip was of the order: foo ├── 1 ├── 2 ├── 3 ├── 4 ├── 5 ├── 6 ├── 7 ├── 8 ├── 9 └── bar ├── 1 ├── 2 ├── 3 ├── 4 ├── 5 ├── 6 ├── 7 ├── 8 └─...


2

First, find out which group the Apache daemon is currently using: $ cat /etc/apache2/apache2.conf | grep ^Group -B 2 # These need to be set in /etc/apache2/envvars User ${APACHE_RUN_USER} Group ${APACHE_RUN_GROUP} OK. This means the group is stored in the APACHE_RUN_GROUP variable: $ echo ${APACHE_RUN_GROUP} That variable isn't set in the current ...


2

Usually this fix for me, add these lines into your wp-config.php: define('WP_HOME','https://example.com'); define('WP_SITEURL','https://example.com'); where both entries contain your new site address. Restart webserver


2

Sounds like you are missing some packages. From HowToForge, try the following: apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt ...


2

According to this page Wordpress stores its local IP/domain name in the database, so you'll have to update it there to prevent the URL from being rewritten to an address you don't want anymore. Connect to your mysql database for the wordpress site and run UPDATE wp_options SET option_value = "http://192.168.2.100" WHERE option_value = 'http://192.168.15....


2

It can take a while to tweak your Apache config to suit your needs. Best to start with only enabling what you need. Then move to tweaking the values for: StartServers MinSpareServers MaxSpareServers ServerLimit MaxClients MaxRequestsPerChild Timeout MaxKeepAliveRequests KeepAliveTimeout Logging is another option to switch off. If you don't need it, ...


2

I would use a slightly different find command, myself: find "${drt}" -path "*/cache/*" -type f -exec rm -f {} \; ... so that find does the work of recursing down the directory tree; your example has the bash command-line expanding all of the *'s, giving find multiple starting paths. Also note that you don't need to -r recursively remove files (you're ...


2

The permission to create a particular directory is not tied to the user account as tightly as you seem to think it is. That is, it's not part of the account's entry in /etc/passwd. A user can create (or delete) a directory in another directory if that other directory is writable by the user or by a group that the user belongs to. This would also permit ...


1

go to your html folder cd /var/www/html check current files in the html folder using ls command ls delete wordpress installation folder from there . you can use terminal to do that. sudo rm -rf * remember -rf forcefully delete all sub-directories . -r > remove the entire directory and all its contents, including subdirectories. f -> force delete ( ...


1

I create final code incrementally, first we find all js files: find <project_dir> -type f -name '*.js' Then we iterate these files: find <project_dir> -type f -name '*.js' | while read file_path; do # Code here run once for every file done Then we create a pattern by using the file name, and use sed to get rid of malicious code in file: ...


1

ifconfig eth0 down Unless you're doing something uncommon (e.g. applying IP aliases) you should not be using ifconfig (or its successor, ip(8)) directly. You should say ifdown eth0 here. That takes care of many things that ifconfig does not. traceroute -i eth0 stackoverflow.com Your route table says the default route is via wlan0, not eth0, so you're ...


1

Don't give that user root access as pointed out by Mat. Instead, give them write permission to the relevant directory hierarchy. Use ps as dr01 mentioned to find the user. If the webserver runs in a multi-user environment with php wrappers, that won't necessarily be the same user under which Wordpress runs, though. In such cases you could run a script in ...


Only top voted, non community-wiki answers of a minimum length are eligible