Assume that your remote origin (repository server URL) is: email@example.com/repository-name.gitÂ and you want to replace it with firstname.lastname@example.org/repository-name.gitÂ .
Command to check your current origins:
You will be able to see the origins for both fetch and push operations:
origin email@example.com/repository-name.git (fetch)
origin firstname.lastname@example.org/repository-name.git (push)
Command to change the GIT repository origin:
git remote set-url origin email@example.com/repository-name.git
That’s it. You now successfully relocated your repository pointing to the new server.
On LinuxÂ systems, it is very easy to copy the files from one computer to another with the secure copy protocol.
Suppose you are logged into the server with SSH and you want to copy the file: /home/user/dummy.txt from the current server folder to your local path: /var/dummy.txt
Do the following steps:
- Exit from the ssh connection.
- Make sure that you are logged into your local machine.
- Execute the following command withÂ the remote computer’s username and host name:
scp username@hostname:/home/user/dummy.txt /var/dummy.txt
- You will be promptedÂ for the password to connect with the server. Type the password to execute the secure copy operation.
- Your file from the remote server is nowÂ copied successfully to the local system. Make sure that the file is copied at the location /var/dummy.txt.
Drop your procedure before modifications
There is no alter command like table alter in mysql for modifying yourÂ MySQL procedure code. So you have to drop your procedure and then create the same procedure for altering your procedure. ToÂ drop the procedure, execute the following line of code in your command shell:
DROP PROCEDURE your_database.your_procedure_name;
Note:Â Mysql ALTER PROCEDUREÂ can be used to change the characteristics of a stored procedure only, not the parameters or body of the procedure.
Change the delimiter
Normally body ofÂ the procedure consists of semicolons (;) for the end of the line (statement). To execute the procedure as a single statement, you have to change the delimiter for the console (commandÂ line interface). You can change theÂ delimiter to ‘/’ by executing the code below:
Execute the CREATE PROCEDURE code
Now you can type/copy your procedure code. An example procedure code is given below for your reference:
CREATE PROCEDURE `database_name`.`procedure_name` () BEGIN
-- Getting total.
SELECT COUNT(`id`) AS 'total' FROM `table_name`;
-- Getting sum.
SELECT SUM(`price`) AS 'sum' FROM `table_name`;
Note the last line of the procedure code. Your procedure will get executed only when you add the changed delimiterÂ /Â .Â If there are no issues with your code, your procedure will add successfully to the server.
Change to delimiter back to normal
You already added the procedure to the database, but make sure that you changed your delimiter back to the normal. Execute the following code for changing the delimiterÂ to the default semicolon.
It is very simple to run your admin panel website or your projects in different ports with Apache web server. The simple instruction to do so is given below.
Open your httpd.conf file and add the following lines of codeÂ at the end of the line:
Restart your server. Access your application at: http://localhost:9000
For other ports, simply replicate the code in your httpd.confÂ file and execute your different projects in different ports.
It is common to see errors like: “permission denied”, that you can see in your applications after uploading the code to your LinuxÂ server. You can simply change many of these errors by providing the properÂ permissions to apache running on your server.
To change the apache running user, execute the below command and open the file with vim:
sudo vim /etc/apache2/envvars
Look through the file contents and modify the lines which resemblesÂ like:
Replace the “www-data” in the first line to your username and for second line, replace with your user’s group name.
Save the file with VIM commands. For more details about VIM commands, please click here.
Restart the server by executing the following command:
sudo service apache2 restart
Now, you can see that your application will run without permission errors.
Note: The whole article is written by assuming that you uploaded all your files to a user owned folder.
There are many ways to install FTP for Linux server, but there is a preferred way to install FTP on Ubuntu servers.
FTP works on a client/server model which transfers file’s data in between as File Transfer Protocol (FTP). The server component in Linux is called an FTP daemon. The FTP helps us to transfer files from the client system to the server. The FTP also can be secured like HTTPS, which will transfer files through the network in a more secure way.
Access to an FTP server can be in two ways:Â Anonymous and Authenticated.Â In the Anonymous mode, clients can access the FTP server by using the default user account called “anonymous”. In the Authenticated mode a user must have an account and a password. Continue reading Install FTP for your Dedicated or Cloud Ubuntu Server