How Unzip a Folder At Jelatics? - unzip

i'm new here. I would like to know how can i unzip a uploaded folder at apache / jelastic / Wordpress, like a folder with all my plugins or images.

You can deploy a project from an archive directly from the Jelastic dashboard - see Upload and Deploy your PHP Application in the official docs - but in this case the archive should contain your entire site (e.g. WordPress and all desired plugins, themes etc.).
Alternatively you can upload your archive (via the dashboard, FTP/S, or SFTP) and then connect to your node via SSH.
Then you can use a command like this to extract the archive in the desired location:
tar -xzvf archive.tar.gz
EDIT: Since you mentioned zip archive, the command to use would be:
unzip archive.zip

Related

AWS Lightsail Wordpress Version control

I'm working on a wordpress site hosted on an AWS Lightsail instance (Bitnami) and i'd like to have version control to work on our site themes with a coworker.
I like the idea of just having to git pull to make changes to the site.
In the wordpress folder (that contains wp-admin, licences, wp-config.php, etc...), there is the wp-content folder but it's a symbolic link that points outside the wordpress folder to root/bitnami/wordpress/wp-content. I can't use git in the wordpress folder but I can set it up in the root/bitnami/wordpress/wp-content but it feels like bad practice since it asks me for admin privileges for every command line.
Is there a reason the wp-content folder is a symbolic link that points to outside the wordpress folder or is it just a mistake from the person who set things up?
Is it okay to use git to bypass an ftp client in this case?
So I just had this same issue today, and I resolved this by moving the directories for .../wp-content to the location of the symlinks and deleting the symlinks.
This was my process (though you could delete the symlinks first):
Move wp-content mv /bitnami/wordpress/wp-content /location/of/wordpress/temporary-directory-name
Delete symlinks rm -f /location/of/wordpress/
Rename temporary-directory-name using move mv /location/of/wordpress/temporary-directory-name /location/of/wordpress/wp-content
You can then repeat the same steps for the wp-config.php file. Once this was done I was able to verify Wordpress was still working on my LightSail instance. Hope this helps

Wordpress path in bash script point to symlink?

I have a bash script on Ubuntu server that is used to do database backups via WP-CLI and use Dropbox Uploader to backup to Dropbox. The script has been working for years on our sites that don't use the Roots Bedrock stack. We recently started use the Bedrock Stack and Capistrano for deploys, and now I want to modify my script to backup databases on these sites. The problem lies in it appears, bash scripts don't understand symlinks for Wordpress path directive. With the Bedrock Stack and server setup, the public directory is a symlink of ~/current/web. Current is the symlink that Capistrano updates to point to the current revision directory. Anyone know how to modify my script to work with symlinks? Here is the script:
#!/bin/bash
# Script to create compressed backup archive of database.
# Set the date format, name, and directory for backups.
NOW=$(date +"%Y%m%d-%H%M")
BACKUP_DIR="/srv/users/serverpilot/apps/backup/public/site"
WP_PATH="/srv/users/serverpilot/apps/site/public"
# MySQL database names
DB_NAME="site_staging"
DB_FILE="site_staging_db_$NOW.sql"
DB_FILEGZ="site_staging_db_$NOW.sql.gz"
# Create the archive and the MySQL dump
wp db export --add-drop-table --path=$WP_PATH $BACKUP_DIR/$DB_FILE
gzip $BACKUP_DIR/$DB_FILE
bash /srv/users/serverpilot/./dropbox_uploader.sh upload $BACKUP_DIR/$DB_FILEGZ /site/
You can use readlink to resolve symbolic links, so in your case you could do something like this:
#!/bin/bash
# The symlinked directory you need to back up
symlink_dir="/srv/users/serverpilot/apps/site/public"
# Set $BACKUP_DIR as the resolved symlink
BACKUP_DIR=$(readlink -f "$symlink_dir")
# Use the absolute path in your backup script
echo "$BACKUP_DIR"
The manpage for readlink outlines a range of other output options.

Git - Track a folder from a separate repository and have a separate repository set up inside of it

I have the following folder structure running on an NGINX server.
-- Laravel installation
-- Magento installation [DOCUMENT ROOT]
-- Laravel's public folder renamed to a different name
-- WordPress installation
The website structure goes something like:
www.example.com = Magento
www.example.com/subsite = Laravel [This is its 'public' folder.
Rest of the folders are placed in a separate folder]
www.example.com/subsite/blogsite = WordPress [Running inside of Laravel]
I had to do the Laravel folder separation because I wanted to make it work as a subdirectory but somehow couldn't figure out how to do it. So I instead followed the Method #1 in this post.
The challenge now is to manage these 3 repositories separately.
I have two major concerns:
How do I track the stranded Laravel public folder which is now inside the Magento repository?
How can I manage the WordPress installation as another separate repository?
1. How do I track the stranded Laravel public folder which is now inside the Magento repository?
As per this answer, you can add external directories to your working tree with this git command:
git --work-tree=/ add /home/some/directory
2. How can I manage the WordPress installation as another separate repository?
You can use .gitignore to ignore the subfolder in the Magento subfolder.
In the Magento root, create a file named .gitignore
In this file, create a list of folders/files you want to ignore, in your case you want to ignore the Wordpress folder within the Laravel directory (assuming it's under public/wordpress.
/public/wordpress/
/public/wordpress/*
Do a git commit: git commit -am 'Ignore the Wordpress folder'
Now you can just create a seperate git tracking instance on the Wordpress folder.

where to put wordpress htaccess on openshift

I have cloned my wordpress application from openshift with git, in my cloned application there is php folder, when i put my htaccess file in it then i commit my changes like this :
git add -A
git commit -m 'ok'
git push
My htaccess file is not pushed in the application repository folder on openshift, but when i put it via ftp with filezilla it works, not with git.
I don't know where i have to put .htaccess file ? if it is in php folder, why it's not uploaded ?
If you used our official quickstart, you would need to use an action_hook (probably deploy) to copy a .htaccess file into place, otherwise the files are actually not stored in a place that is affected by git. You could also try using this quickstart( https://github.com/openshift-quickstart/openshift-wordpress-developer-quickstart) where EVERYTHING except for uploads, is stored in git (plugins, themes, etc)

How to install site-specific modules in a Drupal 7 multi-site?

I have a "multi-site" installation of Drupal 7, which means that I have these folders in my "sites" folder:
all
domain.one
domain.two
domain.x
And in each of these folders, I also have "modules" and "themes" folders.
If I click the "install new module" link on the modules page ("admin/modules") from any domain X, Drupal tries to download modules in the "all/modules" folder instead of the "X/modules" folder.
Maybe I am not using the proper phrase to search in Google, but I do not see similar problems, so it may just be my problem.
How to install site-specific modules in a Drupal 7 multi-site?
You can try the example detailed out in this post: http://www.pixelclever.com/how-set-up-drush-for-multisite-installation which basically requires you to create a drushrc.php file for each multisite, which includes the path to the respective modules folder.
Here are the lines from that post that explain
To start, go to your drush folder where you will find a file entitled example.drushrc.php. Copy that file into the individual site folder in your Drupal multisite installation (sites/yourmultisite), and rename the file to drushrc.php.
Now open that file and add the following line:
$command_specific['dl']['destination'] = 'sites/yourmultisite/modules';
or
$command_specific['dl']['destination'] = 'sites/yourmultisite/modules/contributions';
This is also a step by step walkthrough of the updating process using drush on multisites.
http://rinen.net/2013/02/updating-a-drupal-multisite-using-drush/
I found good article for multisite install here,
http://mydons.com/drupal-7-multisite-install-steps-in-linux/
http://mydons.com/drupal-7-multisite-install-steps-in-windows/
This worked for me:
Changed working directory on terminal to specific site directory
i.e. "cd [drupal_site_directory]/sites/[site_one]/ "
use usual drush command to install modules i.e. "drush dl [module_name]"
Hope this might help you guys also.
.

Resources