server

how to disable direct access to a web site by ip address

狂风中的少年 提交于 2019-12-02 17:07:08
I have a website on a VPS. The issue I am having is that when I enter the IP of the server, it links to the website. Even when entering mail.domain.com, it does the same thing. How do I disable that, so a visitor would get a message or be directed to the domain? I tried disabling the IP and mail a record on cloud flare but it didn't work. My setup is: VPS on Linux Debian Nginx no control panel just command line Cloudflare DNS setup with BIND Chernov You can use redirect, nginx config: server { listen 80; server_name IP_ADDRESS; return 301 http://YOUR.DOMAIN; } AMB server { listen 80 default

Retrofit2 Authorisation with Bearer Token

孤人 提交于 2019-12-02 16:59:00
I'm trying to use Retrofit2 , I want to add Token to my Header Like this: Authorization: Bearer Token but the code below doesn't work: public interface APIService { @Headers({"Authorization", "Bearer "+ token}) @GET("api/Profiles/GetProfile?id={id}") Call<UserProfile> getUser(@Path("id") String id); } My server is asp.net webApi . Please help what should I do? You have two choices -- you can add it as a parameter to your call -- @GET("api/Profiles/GetProfile?id={id}") Call<UserProfile> getUser(@Path("id") String id, @Header("Authorization") String authHeader); This can be a bit annoying

PHP code gets errors in server but works fine in local

隐身守侯 提交于 2019-12-02 13:56:24
I have my site running well on my local but when I uploaded it, the php code gets some error, Warning: mysqli::prepare(): Couldn't fetch mysqli in /home/gh/public_html/abida/C/login.php on line 15 Fatal error: Call to a member function bind_param() on null in /home/gh/public_html/abida/C/login.php on line 16 <?php require '../api/dbcon.php'; require '../api/apiOnly.php'; if(session_id() == '' || !isset($_SESSION)) { // session isn't started session_start(); } //FACULTY - USER LOGIN if(isset($_POST['login'])){ //do query here $stmt = $conn->prepare('SELECT username, campus, designation FROM

Selenium webdriver without making server of the pc

爷,独闯天下 提交于 2019-12-02 13:43:24
问题 I have read the comments below for this question: What are the differences between 'Selenium-server-standalone.jar' and 'Selenium Client & WebDriver'? I would like to ask: Can alone run webdriver without server? I only install selenium with "pip install selenium" and downloaded a chrome webdriver from chrome website. If I run a code like this: from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriver.Firefox() driver.get("http://www.python.org") assert

PHP _Session variable no longer persistate

試著忘記壹切 提交于 2019-12-02 13:31:26
I have wrote a code that has been working for the last past 3 month. Now suddenly, I noticed that my PHP _Session variable no longer persists between the different page for my login. Please note that the code actually works on local, but not on my server (papahost). Here's a very simple version of what i'm trying to do (SESSION persists from class A to B): class function.php <?php function sec_session_start() { //other code goes here session_name('sec_session_id'); $secure = SECURE; // This stops JavaScript being able to access the session id. $httponly = true; if (ini_set('session.use_only

please explain this error log

假装没事ソ 提交于 2019-12-02 12:28:21
i have domain in godaddy and i am trying to install a script in my dedicated server or trying to access my domain righttimematrimony.com it is not loading and showing errors. one time my website loaded and shown sci-bin folder, after upload the data into server and tried to access my url, but shown lot of errors. please somebody help me what to do now. This is the data in error log found at Cpanel -> Error Log. [Mon Dec 29 04:14:23 2014] [alert] [client 106.66.138.199] /home/right/public_html/.htaccess: Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the

REST in Unity (send messages from webserver to unity)

扶醉桌前 提交于 2019-12-02 12:15:19
Is there a way to have a simple webserver send messages to Unity? At the moment, we're doing a GET using UnityWebRequest.Get() in the update method. Here's the code: // Update is called once per frame void Update () { StartCoroutine(GetData()); } IEnumerator GetData() { UnityWebRequest uwr = UnityWebRequest.Get(url); yield return uwr.Send(); if (uwr.isError) { Debug.Log(uwr.error); }else { Debug.Log((float.Parse(uwr.downloadHandler.text) / 100)); fnumber = ((float.Parse(uwr.downloadHandler.text) / 100)); transform.position.Set(oldX, fnumber, oldZ); } } However, this throws this error: CANNOT

Native PHP 5.6 OpenSSL Composer.phar failed to enable crypto on Windows

南楼画角 提交于 2019-12-02 12:01:30
I have a problem with PHP 5.6 native on a Windows machine. I get this error when I try to run a composer update (php composer.phar update): [Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol Failed to enable crypto failed to open stream: operation failed The openssl extension is loaded. I already downloaded this file http://curl.haxx.se/ca/cacert.pem and saved it to a path on my machine and set this path in

Could not find a part of path error on server

跟風遠走 提交于 2019-12-02 11:45:31
问题 I want to run a scheduler on daily basis. So I have created a Windows application and stored it onto the server. This works fine on my local machine, but I get path error as Could not find a part of path C\Windows\System32.. With this, I think there might be some issue related to the path. Here is my code for that. startupPath = Environment.CurrentDirectory; strExp = "RAName = '" + group.Key + "'"; DataTable dtNew = ds.Tables[1].Select(strExp).CopyToDataTable(); DataSet dsNew = new DataSet();

vServer Linux - Start jar: Invalid or corrupt jarfile

时间秒杀一切 提交于 2019-12-02 11:24:20
问题 I'm running a Linux vServer with Debian 8.0 64 bit with 512 MB RAM and 150GB space. Its planned to use it for a game and let a Server.jar run nonstop. The Server is working with Kryonet, a library for simple Client/Server communication. On my server i installed Java 1.8 and its working fine, for testing i downloaded Minecraft server jar, it works perfectly. So i packed my Server into a executable jar with eclipse (compile version 1.8), it worked fine when starting it with cmd on my computer