Edit file permissions using SFTP to Google Cloud Engine Wordpress website - wordpress

My goal is to update 1 file on my Wordpress website on Google Cloud Engine using Filezilla to transfer it.
I am successfully logged into my files using SFTP. I'm on a Mac. I have my vm instance name from Google Cloud Engine but cannot find how to create a password.
I think if I can figure out how to create a ding dang password my next step is to type this in terminal:
sudo chwown "vm-name" /var/www/html
Any direction is much appreciated. My website has been down since yesterday b/c I messed with https plugin. I'm a designer and got in way over my head. Learned more than bargained for so far.

To run any linux command inside your instance you need to:
Generate a private/public key pair using Puttygen.
You need to add the content of your public key to GCP as in below answer.
How can i setup remote project with PhpStorm with Google Compute Engine running LEMP?
You need to open Putty.
In the Session menu enter yourusername#instance_external_ip as a hostname using connection type SSH
In the menu Connection/SSH/Auth browse and select your private key(the one generated at step 1).
Click Open. A new terminal window will open. You will be abel to navigate inside your linux instance and do whatever sudo commands you wish.
Good luck

Related

Google Cloud Engine - Issues When Mounting Storage Bucket To Use With WordPress

I searched thoroughly and could not find any info on this issue.
Currently, I am building a Word Press site, hosted on Google Cloud's Compute Engine. The goal is to build an autoscaling WP site. I am currently attempting to build the instance template, which I can then use to deploy an instance group and subsequently setup the HTTP load balancer.
I am using a base Ubuntu 16.04 image, and from there I installed the rest of the LEMP stack.
I was successfully able to use the SQL proxy to connect to Cloud SQL so that all of the ephermal instances to be deployed will share the same database. To have the proxy initiated each time a new instance is spun up, I am using a startup script:
./cloud_sql_proxy -dir=/cloudsql &
But here's my issue right now: the Word Press files. I can't figure out a way to have all of the instances use the same WP files. I already tried to use Google Cloud Storage FUSE, but when I mount the bucket at the root directory, it deletes all of the WordPress folders (wp-content, wp-admin, wp-includes).
It's as if the instance can't "see" the folders I have in the google cloud storage. Here was my work flow:
setup LEMP with WordPress--got the site working on the front end--all systems go
copied all of the files/folders in my root directory (/var/www/html/) to google cloud bucket
gsutil -m cp -r /var/www/html/. gs://example-bucket/
Then I mounted the bucket at my directory
gcsfuse --dir-mode "777" -o allow_other example-bucket /var/www/html/
But now, when I "ls" inside of the root directory from the Linux terminal, I DON'T see any of the WP folders (wp-includes, wp-admin, wp-content).
My end goal is to have a startup script that:
initiates the DB proxy so all WP instances can share the same DC
initiates the mounting of the google cloud bucket so all instances can share the same WP files
Obviously, that isn't working right now.
What is going wrong here? I am also open to other ideas for how to make the WP files "persistent" and "shared" across all of the ephemeral instances that the instance group spins up.
Try:
sudo nano /etc/rc.local
In the file after:
#By default this script does nothing...
gcsfuse -dir-mode=777 -o allow_other [bucket-name] /var/www/html/[folder-name if apply]
exit 0
Will be work to mount in every scaled instance your bucket.
Hope this help for somebody i realized that you Q has more than 6 months.
:)
Well, there should not be a problem with giving each instance its own WordPress files, unless those files will be modified by the instance.
Each instance can have its own copy of the Wordpress files and all instances can share a common Database. You can host the media files such as images, videos as well as Javascript and CSS files on a Content Delivery Network (CDN)

Setting a cron job in cpanel to transfer file between remote servers

I am currently trying to automate the our online store so that orders from our system get put into our logistics company's server. At the moment, our orders automatically go into a folder called 'automated-orders' on our server through a wordpress plugin. I cannot get this plugin to directly interact with the logistics server.
The goal:
To get a file (.csv file) in our 'automated-orders' folder to automatically (every night) be copied from a directory on our cpanel hosted web server to a ftp location on our logistics company website. Their server requires a login and password. There are some days where there may not be any order files so in this case it will just do nothing. Ideally, it will scan to see if there are any new files before doing the transfer.
I have been looking through these forums and others about cron jobs and wget and wput but don't think I have the syntax right as nothing happens. This is what I have as our cron line command:
wget /home/rhinospo/public_html/automated-orders --ftp-user=RH1 --password='PASSWORD' ftp://RH1#182.50.154.233/RH1/Incoming
Could someone please see what I am doing wrong in this syntax. Alternatively, is there another/better way to achieve what I am trying to do?
Cheers
You can use curl for this chase
curl -T /home/rhinospo/public_html/automated-orders ftp://182.50.154.233/RH1/Incoming --user RH1:password

Root login in instance with eucalyptus

I have a eucalyptus with a node and fronted. I created a instance and i can connect with cloud-user#IpOfIstance. Bu if I get sudo su command, the instance needs a passw of root, but i not created this password. How can I connect in instance with root? root#ip doesn't works
I would be inclined to think that the image you installed isn't properly configured.
Are you able to reproduce the issue with one of the images located at the following URL?
http://emis.eucalyptus.com/
In particular, check out the "Quick start" section to make it more straightforward to install one of the images located there.

Google App Engine local WordPress install error with MAMP

I'm trying to set-up WordPress to run on Google App Engine.
I'm following the docs over here with MAMP as my local dev environment. The app runs okay through the GAE Launcher, but when I browse the localhost:PORT, I get:
Error establishing a database connection
I've tried changing the define('DB_HOST','localhost'); value to localhost:3306 (my MAMP MySQL port), 127.0.0.1, and even the socket address (:/Applications/MAMP/tmp/mysql/mysql.sock) - but I can't get past the database connection error.
I'm wondering if I have misinterpreted the instructions. I originally thought that the database name, username and password were just placeholders that one was supposed to customize, both in Step 3 (create database and user) and 4 (edit config file). But, hoping I could run it remotely on App Engine, I looked at their sample SQL they use to set up the database and they're using the generic terms (wp_user, wp_password) in their SQL stored in Cloud Storage. Does anyone know what is the correct procedure?
I'm seriously stuck. Can someone help?
Try the following:
Remove the ** from DB_NAME, DB_USER and DB_PASSWORD, i.e. use:
define('DB_NAME', 'wordpress_db');
/** MySQL database username */
define('DB_USER', 'wp_user');
/** MySQL database password */
define('DB_PASSWORD', 'wp_password');
When you create your user in MySQL, make sure you use the #localhost terminology as shown.
If all else fails, start with WordPress 3.5.1.
I found a better way of creating a database by following this video by Google Developers.
If you use MAMP, go to terminal and type
/Applications/MAMP/Library/bin/mysql --host=ipaddressOfCloudSQL -uroot -ppassword
Once you login, you can follow the rest of the instructions as follows.
I don't know if you still have this issue, but this is an issue of where the app SDK is looking for the file MYSQL sockets file (mysql.sock). I'm not sure where whether you can configure this somehow, but this worked for me since the default folder that the SDK looks for the file is /tmp:
cd /tmp
ln -s /Applications/MAMP/tmp/mysql/mysql.sock mysql.sock
If you simply link the MAMP sockets files to the one that google's app engine expects locally, it works. :)

Creating a MAMP Local Copy of a Drupal 6 Website

We're currently rebranding a client of ours and it's come the time to take the new brand to their website.
I've not much experience with Drupal other than the theming (I've themed a Drupal website in the past but not very familiar with the software's inner workings).
As this website is live, it's obviously not feasible for me to make any changes to the live environment, so I have downloaded the source files of the website to a local webserver (MAMP).
I also have a MySQL dump of the database.
I'm not sure what files need to be changed inside Drupal to allow access to the MAMP webserver. Could somebody point me in the right direction here?
How would I connect the database to the website, which files need modification?
I think the client is running Drupal 6.
Update:
I've installed the database and linked it up using the below line:
$db_url = 'mysql://root#localhost/databasename';
I've hidden databasename for anonymity.
As it's MAMP, the database has no password. When I load up the website I get an error that install.php is not found. It's not there because the website is already 'installed'.
I've also updated the $base_url to read:
$base_url = 'http://localhost:8888/foldername';
You only need to modify one file, 'sites/default/settings.php'; you'll just need to change the database connection string in there to match your new database settings. There may be a couple of other settings in there you need to tweak depending on the set up of the site (for example the $base_url or $cookie_domain).
Other than that everything in your installation should be relatively path-ed so there shouldn't be any need to make more changes.
i was facing same problem after couple of hours try i got solution : we have to check the DB (tick on list of databases in local host) [ observe this after DB list : Enabling the database statistics here might cause heavy traffic between the web server and the MySQL server. so enable only the db you want to use] this will redirect to http://localhost:8888/foldername/install.php successfully :D :D

Resources