Is there anyway I can use PHPStorm to sync with my EC2 box through SCP? EC2 requires a private key to connect to it. I don't see any option for SCP in the deployment configuration section
SCP is file transfer over SSH, a newer version of which is SFTP. Both just work over SSH, if your server is accessible over SSH then these are the options you have. You're simply looking for the SFTP mechanism in PHPStorm with Auth type of "Key pair".
If you're looking for ES2 deployment integration, check Amazon EC2 plugin. It is compatible with current latest version of PHPStorm. Аmong other features, it provide SSH client allowing connections to EC2 instances.
Installation:
Download latest plugin version.
In PHPStorm open Settings (by default Ctrl+Alt+S). Then Plugins -> Install plugin from disk.
there is a plugin called source sync https://plugins.jetbrains.com/plugin/7374?pr= it might help you. or you may use SCP.
I tried with Phpstorm 3 without success but with the most recent version the ssh connection is working fine.
I was able to have the ssh connexion with the version Webstorm 2018.3
Related
How am I able to install MySQL 5.7 in the cloud on Amazon EC2?
Most of the Amazon Machine Instances (AMIs) that I see either lack any MySQL server or possess an older version such as MySQL Server 5.5
I want to use the latest and greatest.
This is a relatively quick setup of MySQL 5.7.14 on Red Hat Enterprise Linux version 7 (RHEL7).
I am not affiliated with AWS; I just enjoy using their services.
Make sure you have an AWS EC2 account. Note that even though Amazon requires a creditcard on file, there will be no charges incurred for the first year if you adhere to their Free-tier terms. Typically this means a single micro-instance (1 Gb RAM) server running 24/7.
Launch of EC2 RHEL instance
Step 1: On AWS EC2 click "Launch Instance" and select "Red Hat Enterprise Linux 7.2 (HVM), SSD Volume Type - ami-775e4f16" as seen in the picture below. Note that the versions of the available or promoted AMIs (Amazon Machine Instance) will rotate over time and this is as of this writing. But the AMI number is shown above in the text.
Normally, I chose Amazon Linux AMI as my distro of choice. I don't do that anymore as it is their own hodge-podge and there is naturally uncertainty of which package manager to choose and therefore the files. So I stick with RHEL now.
On the "Choose an Instance Type" screen, select a free-tier eligible instance type as seen below:
Click Next. On the next Details screen click "Next" to accept defaults. On the storage screen change the size to 16GB and click "Next". Then "Next" again on Tag info. Next comes the "Configure Security Group" screen pictured below:
Accept the radio button of "🔘 create a new security group" for now. Note SSH port 22 is open to all (Anywhere) IP addresses with the 0.0.0.0/0 CIDR. Other options include detection of "My IP" (as in yours), or "Custom". Rest assured that with the next screen access will be locked down based on Security Keys we will setup. There is a button for Add Rule under the ports open to add such ports as MySQL 3306 or HTTP 80. But for now we will skip that. Note the security group name. Fill one in or accept the default for now. It is not critical to get this right as the security group can be changed later for a running Instance. Click Review and Launch.
Then click "Launch" (fear not, it is not going to Launch yet). As the next screen presents:
Note that as I already have some keypairs generated, it defaults to "Choose an existing keypair" in the first drop-down. Otherwise, you "Create a new key pair" with a given reminder name and proceed to "Download Key Pair". At this point you have the Key Pair as a .pem file. Treat that with the utmost of security, saving it to a place that you will not lose it. Preferably in a password protected area such as under your operating system User directory.
When you finally click "Launch Instances" on this same screen, the launch takes place in relation to that key pair (either just created or a pre-existing one). Note, the generation of a key pair might be a task you perform just once a year. Re-using a key pair again and again, up to you.
After you launch the instance, you have roughly five minutes before it comes live. Under the Instances left menu item, you know the instance is live when the Instance State reads "running" and the Status Checks reads "2/2 passed":
Remember the .pem file that you downloaded? Well just one time you need to create a .ppk file out of that for PuTTY, an SSH client program that will communicate cryto-secured to your running instance. For that we use the puttygen tool that works in harmony with PuTTY. So we run puttygen, load the .pem downloaded minutes before, and generate the .ppk file with a "Key passphrase" such as "I & love%ancHovies2_fjdi8Ha". Below is a picture of puttygen:
And the AWS EC2 page entitled Connecting to Your Linux Instance from Windows Using PuTTY. The steps are File / Load private key. Change the filter to All files (.). Find the .pem file. Hit "Open", then "Ok". Type in a Passphrase. Click "save private key", and save it in the same folder as a .ppk file alongside your .pem file. As mentioned, this is not something you might do but yearly.
Now run PuTTY, the SSH client. Use the Session / Host Name as something like
ec2-user#ec2-www-xxx-yyy-zzz.us-west-2.compute.amazonaws.com
So it is basically ec2-user# concatenated with the Public DNS name that is seen under Instances on the EC2 Control panel. As for specifying the PuTTY .ppk file, it would look like the below, with the .ppk file chosen next to the Browse button:
Go back to the Session upper left hierarchy shown below, give this a profile name under Saved Sessions, and hit "Save". Hereafter when you load PuTTY, you merely load the session by name:
Don't forget that just about all you are doing here is saving the .ppk reference into a friendly named profile. And you may ocassionally need to change Host Name (certainly when you save an Instance image on EC2 and come back in with a new Instance IP address on a subsequent launch).
Ok, it is not easy. But it is what it is.
When you click Open it will attempt to connect to your RHEL instance. Hit Yes on the signature warning. Enter the prior saved .ppk Key Passphrase, and you should be sitting at a Linux prompt.
MySQL Installation (I will put these notes on GitHub)
URL01: Download MySQL Yum Repository
URL02: Chapter 1 Installing MySQL on Linux Using the MySQL Yum Repository
You now have MySQL 5.7.14 loaded and running on EC2 with a database and user setup. Your servers need to be imaged. See this answer here of mine for creating images (AMI's). Backup your data. See the EC2 documentation such as Best Practices for Amazon EC2.
Back to security: best practices certainly suggest not opening up your db to direct connects through Security Groups for port 3306. How you choose to adhere to that is your choice, such as with a PHP, Java, or other programming API. Note that various db client programs can connect through SSH tunnels such as MySQL Workbench. In addition various development libraries exist with SSH Tunnels but they are not terribly easy to develop against (mainly due to difficult key chains and lack of extensive developer experiences). For instance, there is one for C# here.
In addition AWS has RDS and other database offering for less hands-on and rolling your own like the above. The reason many developers target EC2 is due to the fact that you have a full blown server for your other programming initiatives.
If you do modify the Security Groups as mentioned before, please consider using IP Ranges based on CIDR entries and use caution before over-exposing your datastores. Or over granting. Much the same best practices as you would for on-premise work.
Concerning this MySQL section, my GitHub notes for the above few pictures are located Here.
I had the same issue, but i didn’t want to use Red Hat or any other OS than Amazon Linux AMI. So, here is the process to install MySQL 5.7 and upgrade an older version.
Short path (without screenshots)
wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm
yum localinstall mysql57-community-release-el6-11.noarch.rpm
yum remove mysql55 mysql55-common mysql55-libs mysql55-server
yum install mysql-community-server
service mysqld restart
mysql_upgrade -p
Long path (with screenshots)
First of all, just to validate you can check the current version.
Then, you should download the repo for EL6 11
wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm
Next, make a localinstall:
yum localinstall mysql57-community-release-el6-11.noarch.rpm
This is probably the key for a successful installation. You should remove the previous packages, regarding to MySQL 5.5
yum remove mysql55 mysql55-common mysql55-libs mysql55-server
Finally, you can install MySQL 5.7
yum install mysql-community-server
Restart the MySQL Server and upgrade your database
service mysqld restart
mysql_upgrade -p
You can validate you installation by authenticating to MySQL
sudo yum install mysql57-server
How can i install SMB Client on Openshift Gear
Actually i have successfully installed OwnCloud Using https://hub.openshift.com/quickstarts/4-owncloud
but the only problem is after installing the External storage support plugin it gives me hard warning Note: "smbclient" is not installed. Mounting of SMB / CIFS, SMB / CIFS using OC login is not possible. Please ask your system administrator to install it. so it clearly suggest that i need to install smbclient on the server which i cant install as i don't have sufficent privilage on server.
Can anybody help? Any cartrigde or any way to achieve it
SMB is not enabled for users to use on OpenShift online, and you are correct that users do not have the required permissions to install it. unfortunately there is really no way around this. If you need to use SMB Client, you really need your own Virtual Machine that you have root access to to install whatever software you need.
I have downloaded Genymotion and installed it with Oracle Virtualbox 5.0.10 on Windows 10/64bit.
I keep getting the errors:
Virtualization engine not found.
Cannot rename this connection. A connection with the name you specified already exists. Specify a different name.
I've tried uninstall/reinstall, deleted unused network adapters in device manager. I'm at loss.
Thank you all in advance for any help/idea.
You must go the VirtualMachine preferences under File in the menu. Then choose the Network setting, then Host-only Networks.
You can use the - button to delete all of the Ethernet Adapters that you have there.
Then create a new one and use the following settings:
IPv4 Address : 192.168.1.201
IPv4 network mask : 255.255.255.0
Then in the DHCP server tab:
Address: 192.168.1.100
mask: 255.255.255.0
Lower address: 192.168.1.101
Upper address : 192.168.1.199
Check to see which Ethernet adapter # you have now set up - this might be important later on.
Click OK for all the open boxes or save whatever you have.
Then try and run genyMotion again.
This worked for me.
There is one more thing you may have to do if this still doesnt work.
Go to Network and sharing centre . Change adapter settings and disable all the Ethernet connections EXCEPT for the Ethernet adapter you have just created.
I hope that helps
Daniel
For Ubuntu
Almost every GNU/Linux system comes with an installer package for Oracle VM VirtualBox.
Browse for the Oracle VM VirtualBox installer in your directories.
If you do not have the installer or if you need to install a specific version, download and install VirtualBox for Linux hosts from the Download VirtualBox page.
When installing VirtualBox, in the Custom setup window, make sure VirtualBox Networking is enabled.
Go to the Genymotion download page and download the Linux package corresponding to your system.
Run the following commands:
chmod +x <Genymotion installer path>/genymotion-<version>_<arch>.bin
cd <Genymotion installer path>
./genymotion-<version>_<arch>.bin -d <Genymotion installer path>
Run Genymotion using the following command:
cd <Genymotion installer path>
./genymotion
it's possible to use vagrant to setup a environment for php development with some tools like PHP_CodeSniffer, PHP Mess Detector, etc, and then use sublime text plugin sublime-phpcs in the host machine to use this tools from vagrant?
I wanted to avoid install all this tools in my Host machine(mac os) but still use the sublime text with the plugin to develop in the host machine.
Thanks!
Technically you could probably point the sublime-phpcs plugin to an executable bash script which could run PHP on the VM through SSH. Something like this lets you run your VM's PHP:
ssh -i '/path/to/vagrant.pem' vagrant#vmip php
Where vagrant.pem is the SSH key that comes with vagrant.
It would also need to convert the local file path into a path that the VM could actually reach locally as well - either that or perform a reverse SSH connection back to the host.
In the end it's probably going to be very complicated and you might just be better off installing PHP locally.
I found some solutions for Linux here.
But didn't find any solution for Windows. I don't have my.cnf on Windows. I only have my.ini. there is no bind-address in it.
I have already added an inbound rule for MySQL.
Could anybody give me some advice? Thanks a lot!!!
Here's what I would check:
Verify that the MySQL service is up and running by remote desktop'ing to the instance and trying to connect to it on the instance.
If that checks out, try modifying or disabling Windows Firewall to ensure that outside machines can connect on the relevant port. Depending on the Windows version, there might be several places that you need to fiddle with this (i.e. both Windows Firewall and Windows Firewall with advanced security).
If you're using an Asp.Net Application with Entity Framework, you will need to install the MySQL connector on the EC2 instance (I would suggest running iisreset to make sure the dll's are loaded).