Skip to content

Commit

Permalink
Merge pull request GreenFrogSB#68 from GreenFrogSB/dev
Browse files Browse the repository at this point in the history
Dev - WebServ-v2.5
  • Loading branch information
GreenFrogSB authored Feb 11, 2023
2 parents 5e8f6bb + 1a21694 commit 2621fed
Show file tree
Hide file tree
Showing 16 changed files with 171 additions and 4,222 deletions.
2 changes: 1 addition & 1 deletion .templates/plex/service.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plex:
image: ghcr.io/linuxserver/plex:bionic
image: ghcr.io/linuxserver/plex:latest
container_name: plex
network_mode: host
environment:
Expand Down
2 changes: 0 additions & 2 deletions .templates/web/config/mariadb/dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
server {
listen 80;
server_name NG01;
server_name nginx01;

# Log files for Debug
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;

# Laravel web root directory
root /var/www/html;
# web root directory
root /var/www/html/nginx01;
index index.php index.html;

location / {
Expand All @@ -19,7 +19,7 @@ location / {
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php7:9000;
fastcgi_pass php-fpm8:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
Expand Down
29 changes: 29 additions & 0 deletions .templates/web/config/nginx/NG02.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
server {
listen 80;
server_name nginx02;

# Log files for Debug
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;

# web root directory
root /var/www/html/nginx02;
index index.php index.html;

location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}

# Nginx Pass requests to PHP-FPM
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php-fpm8:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
client_max_body_size 256M;
}
}
99 changes: 30 additions & 69 deletions .templates/web/config/nginx/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,81 +7,43 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!-- Bootstrap CSS-->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBo$

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
</head>

<body class=" bg-dark">


<div class="container">
<div class="text-center pt-3">
<body class="bg-dark">
<div class="bg-dark">
<div class="container">
<div class="text-center pt-3">
<div class="bg-dark text-white">
<h1> LMDS WebServer is <font color=#3cfc44>UP </font>(<?php print $_SERVER['SERVER_SOFTWARE']; ?>)</h1>
<h3 class="mb-3">
<font color=#009900>NGINX</font> +
<font color=#cccccc>MariaDB</font> +
<font color=#576490>PHP</font> +
<font color=#6C78AF>php</font>
<font color=#F89C0E>MyAdmin</font>
</h3>

<h1> LMDS <font color=#3cfc44> <?php print $_SERVER['SERVER_NAME']; ?> </font> Web Server is <font color=#3cfc44> UP </font></h1>
<h3 class="mb-3">
<font color=#009900>NGINX</font> +
<font color=#cccccc>MariaDB</font> +
<font color=#576490>PHP</font> +
<font color=#6C78AF>php</font>
<font color=#F89C0E>MyAdmin</font>
</h3>

<p>This <font color=#55b5e2>index.php</font> file is locard in: <br>
<font color=#edd207>~/LMDS/volumes/WebServ/ngnix01/www/html/index.php</font><br>
<p>
This <font color=#55b5e2>index.php</font> file location: <br>
<font color=#edd207>~/LMDS/volumes/WebServ/<?php print $_SERVER['SERVER_NAME']; ?>/www/html/index.php</font><br>
Replace it with your own project.
</p>

<p>
<font color=#edd207>Use your favorite sFTP client to upload your project on the server.</font> <br>
sFTP Server: <?php print strtok($_SERVER['HTTP_HOST'], ':'); ?><br>
USER: Linux local user
</p>

<div class=" bg-dark text-white m-2">
<a target="_blank" href="http://<?php print $_SERVER{
'HTTP_HOST'}; ?>:8888">
<font color=#6C78AF>php</font>
<font color=#F89C0E>MyAdmin</font>
</a>:
<?php print $_SERVER{
'HTTP_HOST'}; ?>:8888<br>

<font color=#edd207>Trouble login into phpMyAdmin - use Chrome Incognito mode.</font>

<br>
SERVER: mariadb<br>
USER: lmds <br>
<a class=" bg-dark" target="_blank" href="http://<?php print strtok($_SERVER['HTTP_HOST'], ':'); ?>:8888"> phpMyAdmin</a>:
<?php print strtok($_SERVER['HTTP_HOST'], ':'); ?>:8888<br>
<font color=#edd207>Trouble login into phpMyAdmin - use Chrome Incognito mode.</font><br>
MariaDB: <?php print strtok($_SERVER['HTTP_HOST'], ':'); ?>:3306<br>
USER: lmds or root <br>
PASSWORD: passw0rd <br>
</div>

<?php
$dbname = 'lmdsdb';
$dbuser = 'lmds';
$dbpass = 'passw0rd';
$dbhost = 'mariadb';

$connect = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
mysqli_select_db($connect, $dbname) or die("Could not open the db '$dbname'");
?>

Database: <?php print $_SERVER{
'HTTP_HOST'}; ?>:3306<br>
MariaDB: <?php echo $connect->server_info; ?>
<?php

$test_query = "SHOW TABLES FROM $dbname";
$result = mysqli_query($connect, $test_query);

$tblCnt = 0;
while ($tbl = mysqli_fetch_array($result)) {
$tblCnt++;
#echo $tbl[0]."<br />\n";
}

if (!$tblCnt) {
echo "<br>There are no tables in the Database";
} else {
echo "<br>There are $tblCnt tables<br>";
}

/* close connection */
$connect->close();
?>
</div>
</div>
</div>
Expand All @@ -90,7 +52,6 @@
// Show all information, defaults to INFO_ALL
phpinfo();
?>

</body>

</html>
</div>
</body>
</html>
50 changes: 0 additions & 50 deletions .templates/web/config/php/dockerfile

This file was deleted.

143 changes: 0 additions & 143 deletions .templates/web/config/php/php-fpm.conf.default

This file was deleted.

Loading

0 comments on commit 2621fed

Please sign in to comment.