Steps To Convert IP Address To Specific Url Name In Linux

Hello,

I have configured https site with IP with self signed certificate. Can some one help me in changing the IP with my own defined url name.

Ex: https://100.100.100.100:8443 to https://abc.com


Similar Content



Http And Https Set Up In Linux Environment.

I need steps start from scratch about hosting a site on http and https in linux along with screen shot if possible. I have installed Apache.

Can you please let me know. I am very new to Linux

Search For A Character In Specific Word In File And Replace It In The Word

Hi all ,
I have a requirement where I have a file. Contents of the file are :
#comments
VAR="abg"
RES=123
#comments
IC6790ABG="https://www.abc.com"
IC5678-vg="https://www.bhy.com"
IC-gy_567:78="https://www.gyt.com"
#comments
The variable names can not have characters like - , : so
in this file I have to find words starting with IC and replace characters like - ,:
I want to change only the variable name , not the whole line.
I have used SED command

sed -i '/^IC/s/[^0-9 a-z A-Z _]*//g' file

when I am using this command , it is replacing the whole line
output becomes :

#comments
VAR="abg"
RES=123
#comments
IC6790ABGhttpswwwabccom
IC5678vghttpswwwbhycom
ICgy56778httpswwwgytcom
#comments


But I want the output like this :

#comments
VAR="abg"
RES=123
#comments
IC6790ABG="https://www.abc.com"
IC5678vg="https://www.bhy.com"
ICgy_56778="https://www.gyt.com"
#comments

How can I get the desired output , thanks for your help in advance .

Nginx Redirect

I have a nginx setup , and there is a redirect in the config to force https, so if a user enters domain.com, they get redirected to https://www.domain.com .

If a user enters https://domain.com, they get an error , because I have no host A record for domain.com, so I want to redirect https to https://www.domain.com when a user enters https://domain.com .

Confusing Tutorials: Which One To Follow?

Hi everyone,
I'm planing to join the development team of Linux kernel. As the first step, I started to clone git repo of the linux-next that I found two contradictory tutorials:

https://www.kernel.org/doc/man-pages/linux-next.html

https://github.com/gregkh/kernel-tut...rnel_patch.txt

Which one should I follow?

Thanks.

Not Using SHA-1 Certificate For Self-signed SSL

Firebug displays the following error when viewing my site:
Quote:
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.
My approach to generate self-signed SSL keys is shown below. I didn't think I was using SHA-1, but thought I was using SHA-256.

What should I do to eliminate this warning?

Thank you

Code:
# generate mysite.coms's RSA keypair with 3072 bits and encrypt it
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:3072 -aes-128-cbc -out mysite_key.pem

# generate a certificate signing request.  Used FQDN of server (i.e. mysite.com).  Use email with dot to prevent spam.  Didn't include an "extra" password
openssl req -new -key mysite_key.pem -sha256 -days 365 -out mysite_csr.pem

# Remove pass-phrase from the key
cp mysite_key.pem mysite_key.pem.tmp
openssl rsa -in mysite_key.pem.tmp -out mysite_key.pem
rm -f mysite_key.pem.tmp

# sign the certificate with the key itself.  Skip this step if using a CA
openssl x509 -req -in mysite_csr.pem -signkey mysite_key.pem -sha256 -days 365 -out mysite_crt.pem

# Copy the files to the correct locations (don't move since it will cause problems with selinux). Be sure to keep at read only by root
cp mysite_key.pem /etc/pki/tls/private/mysite_key.pem
cp mysite_csr.pem /etc/pki/tls/private/mysite_csr.pem
cp mysite_crt.pem /etc/pki/tls/certs/mysite_crt.pem
rm -f mysite_key.pem
rm -f mysite_csr.pem
rm -f mysite_crt.pem

# update /etc/httpd/conf.d/ssl.conf as follows:
# SSLCertificateFile /etc/pki/tls/certs/mysite_crt.pem
# SSLCertificateKeyFile /etc/pki/tls/private/mysite_key.pem

/etc/init.d/httpd restart

Awk Or Sed Help

Hi All,
How can I replace the particular word using sed or awk
Code:
$ BUGZILLAURL="https://mylocalserver.com/bugzilla"
$ PROJECTNAME="mybugs"
$ echo "$BUGZILLAURL/$PROJECTNAME" 
https://mylocalserver.com/bugzilla/mybugs

There is a urlbase line in data/params file which has an empty variable, pls see 2nd line from below command's output.
Code:
$ grep -i "urlbase" data/params 
           'docs_urlbase' => 'docs/%lang%/html/',
           'urlbase' => '',
           'webdotbase' => 'http://www.research.att.com/~north/cgi-bin/webdot.cgi/%urlbase%',

Or search only for that line which I wanted to be as 'urlbase' => 'https://mylocalserver.com/bugzilla/mybugs',
Code:
$ grep -i "'urlbase'" data/params 
           'urlbase' => '',

So expecting your kind help to replace '' word with 'https://mylocalserver.com/bugzilla/mybugs' using sed or awk.

Thanks.

How To Build A Bootable Barebones Linux Installation

https://github.com/boardstretcher/barebones-linux

Have fun. Hopefully this helps some beginners become more interested in the way that Linux comes together with other community tools.

Installing Openshot For Linux

im struggling trying to install openshot for linux. i dont klnow what im supposed to do. many of the linux programs come with typical installers that i recognize from mac and windows. https://launchpad.net/~openshot.deve...ive/ubuntu/ppa

What Is A Good Linux Script For Changing An IP Address Statically In Ubuntu?

I have a shell script that currently changes the mac address of eth0 repeatedly. However, it does not change the public IP address, confirmed by wget -qO- ipinfo.io/ip .

PERIOD=10

while [ 1 ]
do
echo "Changing mac address..."
let lastup=`date +%s`
macchanger -A eth0
let diff=`date +%s`-$lastup
if [ "$diff" -lt "$PERIOD" ]
then
sleep $(($PERIOD-$diff))
echo "Changed mac address successfully."
echo
elif [ "$diff" -gt "$PERIOD" ]
then
echo "Command took longer than iteration period of $PERIOD seconds!"
fi
done

The script needs to change the IP Address statically.

Also, ultimately, what I am trying to accomplish, for security reasons, is to frequently and automatically change a computer's public IP address and mac address. This way, my office's computers, when using the Internet, has an additional form of protection.

How To Convert A Text To Utf-8

I just find the below URL , it shows how to convert file to utf-8 , but it need to check the current encoding first , would advise how can I convert a file to utf-8 without checking the coding first ? thanks

http://ask.xmodulo.com/change-charac...ile-linux.html