hello_world_apache.sh
file, that we are going to use in this tutorial, contains the following code. Create a blank .txt file, transfer the code there, and save it as an .sh file with the exact same file name.#!/bin/bash
zypper -n ar -f $1 SLES
zypper --no-gpg-checks --non-interactive -n install apache2 openssl
#### Enable SSL
echo "Setup apache for SSL"
a2enmod ssl
a2enflag SSL
#### Generate ss cert for apache, you can tweak the attributes below
echo "Generate self-signed cert"
cat > /tmp/openssl.cnf <<EOF
[ req ]
default_bits = 2048
distinguished_name = req_distinguished_name
attributes = req_attributes
prompt = no
output_password =
[ req_distinguished_name ]
C = BG
ST = Test State or Province
L = Test Locality
O = Organization Name
OU = Organizational Unit Name
CN = Common Name
emailAddress = test@email.address
[ req_attributes ]
challengePassword =
EOF
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl.key/server.key -out /etc/apache2/ssl.crt/server.crt -config /tmp/openssl.cnf
chmod 600 /etc/apache2/ssl.key/server.key /etc/apache2/ssl.crt/server.crt
rm /tmp/openssl.cnf
##### Generating default vhost for your site, worning dose not support SNI
echo "Generate vhost for your website"
cat > /etc/apache2/vhosts.d/openstack-ssl.conf <<EOF
<IfDefine SSL>
<IfDefine !NOSSL>
Listen 8041
<VirtualHost _default_:8041>
DocumentRoot "/srv/www/htdocs"
ErrorLog /var/log/apache2/error_log
TransferLog /var/log/apache2/access_log
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCertificateFile /etc/apache2/ssl.crt/server.crt
SSLCertificateKeyFile /etc/apache2/ssl.key/server.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/srv/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/apache2/ssl_request_log ssl_combined
</VirtualHost>
</IfDefine>
</IfDefine>
EOF
echo "Creating test page"
echo "Hello World" > /srv/www/htdocs/index.html
echo "Restart apache"
service apache2 restart
#systemctl reload apache2
cd <path to your SDK tools folder>
command.neo create-vm --size x-small --name myvmname --account mysubaccountname --host hana.ondemand.com --user myemail@example.com
hello_world_apache.sh
script file from your local file system to the virtual machine.neo open-ssh-tunnel --port XXXXX --vm-id c29d0f4d-b755-43c9-aaf4-fdaa1b049ed8 --account mysubaccountname --host hana.ondemand.com --user myemail@example.com
list-vms
command:neo list-vms --account mysubaccountname --host hana.ondemand.com --user myemail@example.com
hello_world_apache.sh
file in the virtual machine.cd /root
command in PuTTY to go to that folder. And if you want to double-check that the .sh file is there, run the ls
command to list all available files in that folder.chmod a+x hello_world_apache.sh
./hello_world_apache.sh https://slesrepo.hana.ondemand.com/repo/SUSE/Products/SLE-SERVER/12/x86_64/product/
hana.ondemand.com
region host is valid for the Europe (Rot/Germany) region. If your virtual machine is hosted on another SAP Cloud Platform region host, choose one of the other available options at Regions and Hosts.neo register-access-point --account mysubaccountname --user myemail@example.com --host hana.ondemand.com --name myvmname
https://[myvmname][mysubaccountname].vms.hana.ondemand.com
. This is what the URL of the virtual machine should look like.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
34 | |
25 | |
12 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |