Apache output web page(layout) not properly - html

I install Apache on CentOS 7,
sudo yum install httpd
then copy this webpage template to /var/www/html/
when I browse /var/www/html/index.html, I got this:
But I browse 127.0.0.1, I got this:
I tried on Chrome and IE, get the same output. The develop console output is the same.
Is my apache missing something ?

I think that your CSS or script paths are not correct/accessible (as long as this site does not require working PHP interpreter)...
Check what happens when you enter the address of CSS/Scripts location.

Related

404 Not Found Error for PHPmyAdmin on DigitalOcean droplet following linking of existing domain name

https://www.digitalocean.com/community/questions/how-to-access-a-java-web-application-by-a-domain-name-using-tomcat-8
After following all the steps and the related guides linked to in the post above, I was able to access my Java Spring application using "mywebsite.com:8080/appname".
Unfortunately, unlike before, I am unable to reach my phpmyadmin installation using either "mywebsite.com/phpmyadmin" or "droplet-ip/phpmyadmin" (which worked fine previously) and instead I get a 404 error saying phpmyadmin directory does not exist.
Additionally, even after following all the tips in said post I'm also unable to reach my app using just "mywebsite.com" and still have to add the additional ":8080/appname", contrary to what the post suggests.
I have tried sudo dpkg-reconfigure phpmyadmin and have been sure to select apache2 during the installation, but still have no success. I can still access my TomCat manager, and the apache home page when using "mywebsite.com" or "droplet-ip".
If any further information is needed, please let me know.
For Ubuntu 15.04 and 16.04
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo service apache2 reload

How can yum download packages from a non-existent base URL?

In order to get the Chrome browser running on RHEL 7.5 I found this yum repo file that helped me install the required package:
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl.google.com/linux/linux_signing_key.pub
Now the installation via yum install google-chrome worked perfectly fine, but I wonder how that's possible, because the baseurl (and any shorter path segment of it) returns an error "404 Not Found". How is it possible that yum downloads packages given this repo file?
It looks like google just return a 404 rather than a directory listing.
If you browse directly to: https://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/repomd.xml the correct xml file is downloaded and behaves normally. I'd guess if you put the full & correct path to a given .rpm you would be able to download that manually as well.

How do I enable the intl extension in CakePHP?

I am using CakePHP 3 and MAMP Pro server for my project. When I am trying to bake the cake, this error shows up:
Fatal error: You must enable the intl extension to use CakePHP.
I have even included intl.so and extension=php_intl.dll in my php.ini file but couldn't figure out solution for this error.
this issue was happening to me some days ago. I had installed Ubuntu 18.04 and php 7.1.
I was trying to run the comman php cake.php bake in orden to use cakephp's console but I was getting the following error message:
You must enable the intl extension to use CakePHP.
This extension (intl) was installed for php 7.1 (php7.1-intl) but this message was appearing every time I used php cake.php bake
After some google searches, I saw that I have to install the extension but with the following command:
sudo apt-get install php-intl
The same issue happened with mbstring extension, I used the command:
sudo apt-get install php-mbstring
then I restarted the apache server with:
sudo service apache2 restart
It's difficult to pinpoint exactly what's wrong without seeing your system setup. However based on what was said in the question, you may be setting up the intl extension incorrectly.
First off, if your OS is Linux/macOS and the PHP extension is a shared library (i.e. has a .so extension) then the php.ini entry should be extension=intl.so not extension=php_intl.dll. Also make sure the intl.so file is in the directory configured under the ini entry extension_dir. Otherwise make sure the extension ini entry is fully qualified (e.g. extension=/path/to/extension/dir/intl.so).
If you are using a Linux OS that has a package manager such as Debian/Ubuntu, you may be able to more easily install the extension for the PHP packaged for that distro. For example, in Ubuntu/Debian the package php5-intl provides the intl extension for PHP5 (I assume it's something similar for PHP7 if you've enabled those repos).
If you build PHP from source, you can try bundling the extension into your PHP. See the instructions from the manual.
I faced the same issue.
I added extension="php_intl.dll" in php.ini and restarted the Apache server.
Now it is working.
I had the same issue. After starting from scratch, I did :
$ brew install php
$ composer install && composer update && composer dump-autoload --optimize
$ composer self-update && composer create-project --prefer-dist cakephp/app:^3.8 cms
$ cd cms
$ bin/cake server
And it was working !

YII2 : kartik Select2

i have worked on project in advanced yii2 , it works fine in localhost but after i upload it there is a message appear that says :
Class 'kartik\select2\select2' not found
the weird thing is : select2 works fine in localhost and i upload all the files
Your solution could be:
use kartik\select2\Select2;
Maybe you are using Windows on localhost and Linux on the remote server.
I assume, that you didn't something like "download to localhost kartik select2, then just copy&paste /vendor/kartik-v/yii2-widget-select2 to server. I hope. Because you shouldn't do like that.
Add this line to require section in project-directory/composer.json file
"kartik-v/yii2-widget-select2": "#dev"
Then run in project directory command:
composer update
If you don't have access to a command line interface in your server to run the composer update command, you need to upload the folder "vendor/composer/" and the "vendor/autoload.php" file to your web server.
When moving your code to production, you have to install all libraries used by composer with
composer install
or
php composer.phar install
Then the same versions of libraries get installed as on your dev site where you tested the application.
This is the reason why in .gitignore the file composer.lock is NOT included: Just to ensure the same lib versions on dev and prod sites.

trac authentication issue with mercurial

I'm trying to get a Trac install working on a Centos box. I have installed Trac (v 0.12.1) and tracmercurial plugin (http://trac.edgewall.org/wiki/TracMercurial) rev ##9946.
So far everything seems to be working fine EXCEPT when i go to the login page. I constantly get the error
"Authentication information not available."
My trac project is at /home/adil/trac-projects . My mercurial repo is at /home/adil/hg/reponame . My htpasswd file is at /home/adil/hg/.htpasswd, world readable.
I would like to use my htpasswd file to login to trac, but as soon as i step in the page i am greeted with a friendly error. I am initializing tracd like so :
sudo tracd --port 8002 --basic-auth=\"trac-projects,/home/adil/hg/.htpasswd,Private\" /home/adil/trac-projects
The reason i mentioned mercurial is because it seemed to work when the plugin was not installed. But i need both.
What gives?