33 ‐ Steps to Prepare OCI Instance for Web and SSH Access - SanjeevOCI/Study GitHub Wiki
-
Network Setup in OCI Console
- Create Internet Gateway for your VCN.
- Update Route Table for your App Subnet to route
0.0.0.0/0
traffic to the Internet Gateway. - Add Security List Rule to App Subnet:
- Ingress rule: Source CIDR
0.0.0.0/0
, Destination Port80
(TCP), Allow HTTP traffic.
- Ingress rule: Source CIDR
-
SSH Access Setup
- Login via SSH using Putty and your private key.
- Edit
/etc/ssh/sshd_config
:PasswordAuthentication yes PermitRootLogin yes AllowUsers opc root UsePAM yes
- Restart SSH service:
sudo systemctl restart sshd
-
Install Apache Web Server
- Install Apache (httpd):
sudo yum install httpd -y
- Start and enable Apache:
sudo systemctl start httpd sudo systemctl enable httpd
- Install Apache (httpd):
-
Prepare Web Directory
- Create
/var/www/html
if missing:sudo mkdir -p /var/www/html
- Create
index.html
:echo "<h1>Hello, World!</h1>" | sudo tee /var/www/html/index.html
- Create
-
Firewall Settings
- Stop/disable firewall (if running):
sudo systemctl stop firewalld sudo systemctl disable firewalld
- Stop/disable firewall (if running):
-
Test Access
- SSH: Connect using Putty with password or key.
- Web: Open
http://<public-ip>/
in your browser to seeindex.html
.
Note:
- Disabling firewalls and enabling root login/password authentication can be insecure. Use these settings only for testing or in trusted environments.
- For production, use SSH keys and restrict